Skip to content

Commit e11d51e

Browse files
committed
address comment
1 parent 9cc993d commit e11d51e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

compiler/semexprs.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ proc isOpImpl(c: PContext, n: PNode, flags: TExprFlags): PNode =
396396
else:
397397
res = false
398398
else:
399-
if t1.skipTypes({tyAlias}).kind != tyGenericBody:
399+
if t1.skipTypes({tyGenericInst, tyAlias, tySink, tyDistinct}).kind != tyGenericBody:
400400
maybeLiftType(t2, c, n.info)
401401
else:
402402
#[

tests/metatype/ttypetraits.nim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ block genericHead:
129129
type FooInst = Foo[int, float]
130130
type Foo2 = genericHead(FooInst)
131131
doAssert Foo2 is Foo # issue #13066
132+
133+
block:
134+
type Goo[T] = object
135+
type Moo[U] = object
136+
type Hoo = Goo[Moo[float]]
137+
type Koo = genericHead(Hoo)
138+
doAssert Koo is Goo
139+
doAssert genericParams(Hoo) is (Moo[float],)
140+
doAssert genericParams(Hoo).get(0) is Moo[float]
141+
doAssert genericHead(genericParams(Hoo).get(0)) is Moo
142+
132143
type Foo2Inst = Foo2[int, float]
133144
doAssert FooInst.default == Foo2Inst.default
134145
doAssert FooInst.default.x2 == 0.0

0 commit comments

Comments
 (0)