diff --git a/compiler/types.nim b/compiler/types.nim index 2f2e9c8c43..8e0d73d0fa 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -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: diff --git a/tests/generics/t22826.nim b/tests/generics/t22826.nim deleted file mode 100644 index 914d4243a2..0000000000 --- a/tests/generics/t22826.nim +++ /dev/null @@ -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]()}) \ No newline at end of file