Skip to content

Commit b5963a0

Browse files
committed
address comment
1 parent 970d986 commit b5963a0

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
@@ -134,6 +134,17 @@ block genericHead:
134134
type FooInst = Foo[int, float]
135135
type Foo2 = genericHead(FooInst)
136136
doAssert Foo2 is Foo # issue #13066
137+
138+
block:
139+
type Goo[T] = object
140+
type Moo[U] = object
141+
type Hoo = Goo[Moo[float]]
142+
type Koo = genericHead(Hoo)
143+
doAssert Koo is Goo
144+
doAssert genericParams(Hoo) is (Moo[float],)
145+
doAssert genericParams(Hoo).get(0) is Moo[float]
146+
doAssert genericHead(genericParams(Hoo).get(0)) is Moo
147+
137148
type Foo2Inst = Foo2[int, float]
138149
doAssert FooInst.default == Foo2Inst.default
139150
doAssert FooInst.default.x2 == 0.0

0 commit comments

Comments
 (0)