mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-28 19:36:34 +00:00
made some tests green
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user