mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
fix typeRel of typeDesc (#21227)
This commit is contained in:
@@ -1840,7 +1840,9 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
|
||||
elif f.base.kind == tyNone:
|
||||
result = isGeneric
|
||||
else:
|
||||
result = typeRel(c, f.base, a.base, flags)
|
||||
let r = typeRel(c, f.base, a.base, flags)
|
||||
if r >= isIntConv:
|
||||
result = r
|
||||
|
||||
if result != isNone:
|
||||
put(c, f, a)
|
||||
@@ -1848,7 +1850,9 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
|
||||
if tfUnresolved in f.flags:
|
||||
result = typeRel(c, prev.base, a, flags)
|
||||
elif a.kind == tyTypeDesc:
|
||||
result = typeRel(c, prev.base, a.base, flags)
|
||||
let r = typeRel(c, prev.base, a.base, flags)
|
||||
if r >= isIntConv:
|
||||
result = r
|
||||
else:
|
||||
result = isNone
|
||||
|
||||
|
||||
4
tests/typerel/tint.nim
Normal file
4
tests/typerel/tint.nim
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
template a(T: type int32) = discard
|
||||
template a(T: type int64) = discard
|
||||
a(int)
|
||||
Reference in New Issue
Block a user