Revert "Fix #22826: Don't skip generic instances in type comparison (#22828)"

This reverts commit 5e20e935dd.
This commit is contained in:
narimiran
2024-06-07 16:30:32 +02:00
parent 36f8cccda4
commit 767a901267
2 changed files with 4 additions and 12 deletions

View File

@@ -1211,12 +1211,12 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
if containsOrIncl(c, a, b): return true
if x == y: return true
var a = skipTypes(x, {tyAlias})
var a = skipTypes(x, {tyGenericInst, tyAlias})
while a.kind == tyUserTypeClass and tfResolved in a.flags:
a = skipTypes(a[^1], {tyAlias})
var b = skipTypes(y, {tyAlias})
a = skipTypes(a[^1], {tyGenericInst, tyAlias})
var b = skipTypes(y, {tyGenericInst, tyAlias})
while b.kind == tyUserTypeClass and tfResolved in b.flags:
b = skipTypes(b[^1], {tyAlias})
b = skipTypes(b[^1], {tyGenericInst, tyAlias})
assert(a != nil)
assert(b != nil)
if a.kind != b.kind:

View File

@@ -1,8 +0,0 @@
import std/tables
var a: Table[string, float]
type Value*[T] = object
table: Table[string, Value[T]]
discard toTable({"a": Value[float]()})