diff options
-rw-r--r-- | compiler/semtypes.nim | 4 | ||||
-rw-r--r-- | tests/metatype/tmetatype_issues.nim | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 857521232..9af71ba8f 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -2167,7 +2167,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = if s.kind != skError: localError(c.config, n.info, errTypeExpected) result = newOrPrevType(tyError, prev, c) elif s.kind == skParam and s.typ.kind == tyTypeDesc: - internalAssert c.config, s.typ.base.kind != tyNone and prev == nil + internalAssert c.config, s.typ.base.kind != tyNone result = s.typ.base elif prev == nil: result = s.typ @@ -2191,7 +2191,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = if s.kind == skType: s.typ else: - internalAssert c.config, s.typ.base.kind != tyNone and prev == nil + internalAssert c.config, s.typ.base.kind != tyNone s.typ.base let alias = maybeAliasType(c, t, prev) if alias != nil: diff --git a/tests/metatype/tmetatype_issues.nim b/tests/metatype/tmetatype_issues.nim index 21c5c02f1..d33d8dd31 100644 --- a/tests/metatype/tmetatype_issues.nim +++ b/tests/metatype/tmetatype_issues.nim @@ -157,3 +157,12 @@ block t3338: var t2 = Bar[int32]() t2.add() doAssert t2.x == 5 + +block: # issue #24203 + proc b(G: typedesc) = + type U = G + template s(h: untyped) = h + s(b(typeof (0, 0))) + b(seq[int]) + b((int, int)) + b(typeof (0, 0)) |