Allow typeof(nil) as a return type

This commit is contained in:
Albert Safin 2019-08-31 09:46:13 +00:00
commit efe1bed82e
4 changed files with 8 additions and 2 deletions

View file

@ -1310,7 +1310,7 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
tyNone, tyForward, tyFromExpr:
result = t
of tyNil:
if kind != skConst and kind != skParam: result = t
if kind != skConst and kind != skParam and kind != skResult: result = t
of tyString, tyBool, tyChar, tyEnum, tyInt..tyUInt64, tyCString, tyPointer:
result = nil
of tyOrdinal: