* Fix #14990

* Add testcase
This commit is contained in:
Clyybber 2020-07-15 19:00:52 +02:00 • committed by GitHub
commit e057b1d839
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View file

@ -1402,8 +1402,8 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType =
[s.name.s, s.kind.toHumanStr]) [s.name.s, s.kind.toHumanStr])
return newOrPrevType(tyError, prev, c) return newOrPrevType(tyError, prev, c)
var t = s.typ var t = s.typ.skipTypes({tyAlias})
if t.kind in {tyCompositeTypeClass, tyAlias} and t.base.kind == tyGenericBody: if t.kind == tyCompositeTypeClass and t.base.kind == tyGenericBody:
t = t.base t = t.base
result = newOrPrevType(tyGenericInvocation, prev, c) result = newOrPrevType(tyGenericInvocation, prev, c)

View file

@ -849,3 +849,14 @@ discard getBar(fakeReadLine()) # no error
discard getBar("hello, world") # no error discard getBar("hello, world") # no error
echo intoFoos(fakeReadLine().split(' ')) # no error, works as expected echo intoFoos(fakeReadLine().split(' ')) # no error, works as expected
# bug #14990
type
Tile3 = Tile2
Tile2 = Tile
Tile[n] = object
a: n
var a: Tile3[int]