Skip to content

Commit

Permalink
Revert "Fix #22826: Don't skip generic instances in type comparison (#…
Browse files Browse the repository at this point in the history
…22828)"

This reverts commit 5e20e93.
  • Loading branch information
narimiran committed Jun 7, 2024
1 parent 36f8ccc commit 767a901
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 4 additions & 4 deletions compiler/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 0 additions & 8 deletions tests/generics/t22826.nim

This file was deleted.

0 comments on commit 767a901

Please sign in to comment.