mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-08 22:13:29 +00:00
@@ -1942,6 +1942,8 @@ proc localConvMatch(c: PContext, m: var TCandidate, f, a: PType,
|
||||
|
||||
if result != nil:
|
||||
if result.typ == nil: return nil
|
||||
# bug #13378, ensure we produce a real generic instantiation:
|
||||
result = c.semExpr(c, call)
|
||||
# resulting type must be consistent with the other arguments:
|
||||
var r = typeRel(m, f[0], result.typ)
|
||||
if r < isGeneric: return nil
|
||||
|
||||
@@ -4,6 +4,7 @@ discard """
|
||||
0
|
||||
float32
|
||||
float32
|
||||
(name: "Resource 1", readers: ..., writers: ...)
|
||||
'''
|
||||
"""
|
||||
|
||||
@@ -124,3 +125,18 @@ block tgeneric5:
|
||||
echo T
|
||||
|
||||
bar(0.0'f32)
|
||||
|
||||
# bug #13378
|
||||
|
||||
type
|
||||
Resource = ref object of RootObj
|
||||
name: string
|
||||
readers, writers: seq[RenderTask]
|
||||
|
||||
RenderTask = ref object
|
||||
name: string
|
||||
|
||||
var res = Resource(name: "Resource 1")
|
||||
|
||||
(proc (r: typeof(res)) =
|
||||
echo r[])(res)
|
||||
|
||||
Reference in New Issue
Block a user