mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-02 20:14:44 +00:00
Close #22826
I am not sure why this code skips generic insts, so letting CI tell me.
Update: It has told me nothing. Maybe someone knows during review.
Issue itself seems to be that the generic instance is skipped thus it
ends up being just `float` which makes it use the wrong generic instance
of the proc because it matches the one in cache
---------
Co-authored-by: SirOlaf <>
(cherry picked from commit c13c48500b)
This commit is contained in:
@@ -1209,12 +1209,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, {tyGenericInst, tyAlias})
|
||||
var a = skipTypes(x, {tyAlias})
|
||||
while a.kind == tyUserTypeClass and tfResolved in a.flags:
|
||||
a = skipTypes(a[^1], {tyGenericInst, tyAlias})
|
||||
var b = skipTypes(y, {tyGenericInst, tyAlias})
|
||||
a = skipTypes(a[^1], {tyAlias})
|
||||
var b = skipTypes(y, {tyAlias})
|
||||
while b.kind == tyUserTypeClass and tfResolved in b.flags:
|
||||
b = skipTypes(b[^1], {tyGenericInst, tyAlias})
|
||||
b = skipTypes(b[^1], {tyAlias})
|
||||
assert(a != nil)
|
||||
assert(b != nil)
|
||||
if a.kind != b.kind:
|
||||
|
||||
Reference in New Issue
Block a user