made built-in types primary expressions to allow infix operators to be used with them

This commit is contained in:
Zahary Karadjov 2012-04-20 21:35:59 +03:00
commit c1d16c5a4d
3 changed files with 52 additions and 54 deletions

View file

@ -18,7 +18,8 @@ proc checkPartialConstructedType(info: TLineInfo, t: PType) =
LocalError(info, errVarVarTypeNotAllowed)
proc checkConstructedType*(info: TLineInfo, t: PType) =
if tfAcyclic in t.flags and skipTypes(t, abstractInst).kind != tyObject:
if t.kind in {tyTypeClass}: nil
elif tfAcyclic in t.flags and skipTypes(t, abstractInst).kind != tyObject:
LocalError(info, errInvalidPragmaX, "acyclic")
elif t.kind == tyVar and t.sons[0].kind == tyVar:
LocalError(info, errVarVarTypeNotAllowed)