special typing rules for owned pointers
This commit is contained in:
parent
0fd5417aff
commit
a6d49c3a81
6 changed files with 52 additions and 19 deletions
|
|
@ -474,6 +474,10 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode =
|
|||
($typ.kind).substr(2).toLowerAscii)
|
||||
elif typ.kind == tyProc and tfUnresolved in typ.flags:
|
||||
localError(c.config, def.info, errProcHasNoConcreteType % def.renderTree)
|
||||
elif symkind == skVar and typ.kind == tyOwned and def.kind notin nkCallKinds:
|
||||
# special type inference rule: 'var it = ownedPointer' is turned
|
||||
# into an unowned pointer.
|
||||
typ = typ.lastSon
|
||||
else:
|
||||
if symkind == skLet: localError(c.config, a.info, errLetNeedsInit)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue