interpret tuple as a class and tuple[] as the empty tuple

When the indentation syntax is allowed it is always interpreted as a
tuple:

type
  Unit = tuple
This commit is contained in:
Max Zerzouri 2015-03-01 15:25:20 +13:00
commit 9c126282b2
8 changed files with 16 additions and 11 deletions

View file

@ -2055,7 +2055,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
of nkBind:
message(n.info, warnDeprecated, "bind")
result = semExpr(c, n.sons[0], flags)
of nkTypeOfExpr, nkTupleTy, nkRefTy..nkEnumTy, nkStaticTy:
of nkTypeOfExpr, nkTupleTy, nkTupleClassTy, nkRefTy..nkEnumTy, nkStaticTy:
var typ = semTypeNode(c, n, nil).skipTypes({tyTypeDesc, tyIter})
result.typ = makeTypeDesc(c, typ)
#result = symNodeFromType(c, typ, n.info)