made some tests green

This commit is contained in:
Araq
2014-09-21 23:57:54 +02:00
parent 8e52384407
commit 3866820eee
11 changed files with 53 additions and 49 deletions

View File

@@ -104,7 +104,7 @@ proc guardGlobal(a: PEffects; n: PNode; guard: PSym) =
# (var x{.guard: y.}: int)
proc guardDotAccess(a: PEffects; n: PNode) =
let ri = n.sons[1]
internalAssert ri.kind == nkSym and ri.sym.kind == skField
if ri.kind != nkSym or ri.sym.kind != skField: return
var g = ri.sym.guard
if g.isNil or a.isTopLevel: return
# fixup guard:

View File

@@ -448,7 +448,7 @@ proc semConst(c: PContext, n: PNode): PNode =
if typ == nil:
localError(a.sons[2].info, errConstExprExpected)
continue
if not typeAllowed(typ, skConst):
if not typeAllowed(typ, skConst) and def.kind != nkNilLit:
localError(a.info, errXisNoType, typeToString(typ))
continue
v.typ = typ

View File

@@ -1342,6 +1342,9 @@ proc semGenericParamList(c: PContext, n: PNode, father: PType = nil): PNode =
if def.typ.kind != tyTypeDesc:
typ = newTypeWithSons(c, tyStatic, @[def.typ])
else:
# the following line fixes ``TV2*[T:SomeNumber=TR] = array[0..1, T]``
# from manyloc/named_argument_bug/triengine:
def.typ = def.typ.skipTypes({tyTypeDesc})
if not containsGenericType(def.typ):
def = fitNode(c, typ, def)