fixes #1658
This commit is contained in:
parent
a1b937ab33
commit
06feaef64a
2 changed files with 16 additions and 1 deletions
|
|
@ -789,7 +789,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode,
|
||||||
@[newTypeS(paramType.kind, c)])
|
@[newTypeS(paramType.kind, c)])
|
||||||
result = addImplicitGeneric(typ)
|
result = addImplicitGeneric(typ)
|
||||||
else:
|
else:
|
||||||
for i in 0 .. <paramType.sons.len:
|
for i in 0 .. <paramType.len:
|
||||||
if paramType.sons[i] == paramType:
|
if paramType.sons[i] == paramType:
|
||||||
globalError(info, errIllegalRecursionInTypeX, typeToString(paramType))
|
globalError(info, errIllegalRecursionInTypeX, typeToString(paramType))
|
||||||
var lifted = liftingWalk(paramType.sons[i])
|
var lifted = liftingWalk(paramType.sons[i])
|
||||||
|
|
|
||||||
15
tests/objects/tobjloop.nim
Normal file
15
tests/objects/tobjloop.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
discard """
|
||||||
|
output: "is Nil false"
|
||||||
|
"""
|
||||||
|
# bug #1658
|
||||||
|
|
||||||
|
type
|
||||||
|
Loop* = ref object
|
||||||
|
onBeforeSelect*: proc (L: Loop)
|
||||||
|
|
||||||
|
var L: Loop
|
||||||
|
new L
|
||||||
|
L.onBeforeSelect = proc (bar: Loop) =
|
||||||
|
echo "is Nil ", bar.isNil
|
||||||
|
|
||||||
|
L.onBeforeSelect(L)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue