fix is with generic types; fix genericHead(Foo[T]) (#13303)
* fix #9855, fix #9855, fix genericHead * render TTypeKind via toHumanStr
This commit is contained in:
parent
debe7fffd8
commit
7939319379
7 changed files with 94 additions and 20 deletions
|
|
@ -89,3 +89,23 @@ proc test[T](x: T) =
|
|||
echo "no"
|
||||
|
||||
test(7)
|
||||
|
||||
block:
|
||||
# bug #13066
|
||||
type Bar[T1,T2] = object
|
||||
type Foo[T1,T2] = object
|
||||
type Foo2 = Foo
|
||||
doAssert Foo2 is Foo
|
||||
doAssert Foo is Foo2
|
||||
doAssert Foo is Foo
|
||||
doAssert Foo2 is Foo2
|
||||
doAssert Foo2 isnot Bar
|
||||
doAssert Foo[int,float] is Foo2[int,float]
|
||||
|
||||
# other
|
||||
doAssert Foo[int,float] isnot Foo2[float,float]
|
||||
doAssert Foo[int,float] is Foo2
|
||||
doAssert Foo[int,float|int] is Foo2
|
||||
doAssert Foo2[int,float|int] is Foo
|
||||
doAssert Foo2[int,float|int] isnot Bar
|
||||
doAssert int is (int|float)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue