progress towards fixing tgenericshardcases

This commit is contained in:
Zahary Karadjov
2014-01-06 00:15:55 +02:00
parent 789ba107cf
commit 1ffae7cbaf
9 changed files with 146 additions and 43 deletions

View File

@@ -218,6 +218,16 @@ proc makeTypeFromExpr*(c: PContext, n: PNode): PType =
result = newTypeS(tyFromExpr, c)
result.n = n
proc newTypeWithSons*(c: PContext, kind: TTypeKind,
sons: seq[PType]): PType =
result = newType(kind, getCurrOwner())
result.sons = sons
proc makeStaticExpr*(c: PContext, n: PNode): PNode =
result = newNodeI(nkStaticExpr, n.info)
result.sons = @[n]
result.typ = newTypeWithSons(c, tyStatic, @[n.typ])
proc makeAndType*(c: PContext, t1, t2: PType): PType =
result = newTypeS(tyAnd, c)
result.sons = @[t1, t2]
@@ -238,11 +248,6 @@ proc makeNotType*(c: PContext, t1: PType): PType =
proc newTypeS(kind: TTypeKind, c: PContext): PType =
result = newType(kind, getCurrOwner())
proc newTypeWithSons*(c: PContext, kind: TTypeKind,
sons: seq[PType]): PType =
result = newType(kind, getCurrOwner())
result.sons = sons
proc errorType*(c: PContext): PType =
## creates a type representing an error state
result = newTypeS(tyError, c)