mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 23:41:29 +00:00
* revert #21227 but keep test * add test for #21677 * don't export * delete test
This commit is contained in:
@@ -1849,9 +1849,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
|
||||
elif f.base.kind == tyNone:
|
||||
result = isGeneric
|
||||
else:
|
||||
let r = typeRel(c, f.base, a.base, flags)
|
||||
if r >= isIntConv:
|
||||
result = r
|
||||
result = typeRel(c, f.base, a.base, flags)
|
||||
|
||||
if result != isNone:
|
||||
put(c, f, a)
|
||||
@@ -1859,9 +1857,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
|
||||
if tfUnresolved in f.flags:
|
||||
result = typeRel(c, prev.base, a, flags)
|
||||
elif a.kind == tyTypeDesc:
|
||||
let r = typeRel(c, prev.base, a.base, flags)
|
||||
if r >= isIntConv:
|
||||
result = r
|
||||
result = typeRel(c, prev.base, a.base, flags)
|
||||
else:
|
||||
result = isNone
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
template a(T: type int32) = discard
|
||||
template a(T: type int64) = discard
|
||||
a(int)
|
||||
@@ -5,3 +5,18 @@ p(type((5, 6))) # Compiles
|
||||
(type((5, 6))).p # Doesn't compile (SIGSEGV: Illegal storage access.)
|
||||
type T = type((5, 6)) # Doesn't compile (SIGSEGV: Illegal storage access.)
|
||||
|
||||
block: # issue #21677
|
||||
type
|
||||
Uints = uint16|uint32
|
||||
|
||||
template constructor(name: untyped, typ: typedesc[Uints], typ2: typedesc[Uints]) =
|
||||
type
|
||||
name = object
|
||||
data: typ
|
||||
data2: typ2
|
||||
|
||||
proc `init name`(data: typ, data2: typ2): name =
|
||||
result.data = data
|
||||
result.data2 = data2
|
||||
|
||||
constructor(Test, uint32, uint16)
|
||||
|
||||
Reference in New Issue
Block a user