mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fixes #1658
This commit is contained in:
@@ -789,7 +789,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode,
|
||||
@[newTypeS(paramType.kind, c)])
|
||||
result = addImplicitGeneric(typ)
|
||||
else:
|
||||
for i in 0 .. <paramType.sons.len:
|
||||
for i in 0 .. <paramType.len:
|
||||
if paramType.sons[i] == paramType:
|
||||
globalError(info, errIllegalRecursionInTypeX, typeToString(paramType))
|
||||
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)
|
||||
Reference in New Issue
Block a user