diff options
author | Araq <rumpf_a@web.de> | 2018-05-14 21:38:18 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-05-14 21:38:18 +0200 |
commit | 02b78d3f94225ab1b204191d0fb199125787f31d (patch) | |
tree | 03c3a5595edf56c8d219c92fec14358c1bf76d69 | |
parent | 5526252fa0218816c3ca5399a7cb927d9b2bbdc4 (diff) | |
download | Nim-02b78d3f94225ab1b204191d0fb199125787f31d.tar.gz |
make tests green again
-rw-r--r-- | compiler/parser.nim | 2 | ||||
-rw-r--r-- | compiler/semcall.nim | 4 | ||||
-rw-r--r-- | compiler/seminst.nim | 4 | ||||
-rw-r--r-- | compiler/sempass2.nim | 2 | ||||
-rw-r--r-- | compiler/semstmts.nim | 2 | ||||
-rw-r--r-- | compiler/semtypes.nim | 8 | ||||
-rw-r--r-- | compiler/semtypinst.nim | 4 | ||||
-rw-r--r-- | compiler/sigmatch.nim | 4 | ||||
-rw-r--r-- | compiler/types.nim | 2 | ||||
-rw-r--r-- | tests/controlflow/tstatret.nim | 2 | ||||
-rw-r--r-- | tests/errmsgs/tinvalidinout.nim | 8 | ||||
-rw-r--r-- | tests/lexer/tunderscores.nim | 2 | ||||
-rw-r--r-- | tests/misc/tunsignedmisc.nim | 2 | ||||
-rw-r--r-- | tests/objvariant/temptycaseobj.nim | 2 | ||||
-rw-r--r-- | tests/parser/tinvcolonlocation1.nim | 4 | ||||
-rw-r--r-- | tests/parser/tinvcolonlocation2.nim | 4 | ||||
-rw-r--r-- | tests/parser/tinvcolonlocation3.nim | 4 | ||||
-rw-r--r-- | tests/parser/twhen_in_enum.nim | 2 | ||||
-rw-r--r-- | tests/types/tparameterizedparent3.nim | 2 | ||||
-rw-r--r-- | tests/types/tparameterizedparent4.nim | 2 |
20 files changed, 33 insertions, 33 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim index 082dcd9ed..fbc57ebb6 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -183,7 +183,7 @@ proc eat(p: var TParser, tokType: TTokType) = getTok(p) else: lexMessage(p.lex, errGenerated, - "expected " & TokTypeToStr[tokType] & ", but got: " & prettyTok(p.tok)) + "expected: '" & TokTypeToStr[tokType] & "', but got: '" & prettyTok(p.tok) & "'") proc parLineInfo(p: TParser): TLineInfo = ## Retrieve the line information associated with the parser's current state. diff --git a/compiler/semcall.nim b/compiler/semcall.nim index b4d4cad7e..e9a31d3d6 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -507,8 +507,8 @@ proc explicitGenericInstantiation(c: PContext, n: PNode, s: PSym): PNode = # number of generic type parameters: if safeLen(s.ast.sons[genericParamsPos]) != n.len-1: let expected = safeLen(s.ast.sons[genericParamsPos]) - localError(c.config, n.info, errGenerated, "cannot instantiate: " & renderTree(n) & - "; got " & $(n.len-1) & " type(s) but expected " & $expected) + localError(c.config, n.info, errGenerated, "cannot instantiate: '" & renderTree(n) & + "'; got " & $(n.len-1) & " type(s) but expected " & $expected) return n result = explicitGenericSym(c, n, s) if result == nil: result = explicitGenericInstError(c, n) diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 60c655bba..a5f0ca7d8 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -74,10 +74,10 @@ iterator instantiateGenericParamList(c: PContext, n: PNode, pt: TIdTable): PSym # later by semAsgn in return type inference scenario t = q.typ else: - localError(c.config, a.info, errCannotInstantiateX & s.name.s) + localError(c.config, a.info, errCannotInstantiateX % s.name.s) t = errorType(c) elif t.kind == tyGenericParam: - localError(c.config, a.info, errCannotInstantiateX & q.name.s) + localError(c.config, a.info, errCannotInstantiateX % q.name.s) t = errorType(c) elif t.kind == tyGenericInvocation: #t = instGenericContainer(c, a, t) diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index 543161524..b66d7d9f2 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -970,7 +970,7 @@ proc trackProc*(g: ModuleGraph; s: PSym, body: PNode) = when false: listGcUnsafety(s, onlyWarning=false, g.config) else: - localError(g.config, s.info, "'$1' has side effects" % s.name.s) + localError(g.config, s.info, "'$1' can have side effects" % s.name.s) if not t.gcUnsafe: s.typ.flags.incl tfGcSafe if not t.hasSideEffect and sfSideEffect notin s.flags: diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 2d4b5ae77..3687e50e9 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -233,7 +233,7 @@ proc semCase(c: PContext, n: PNode): PNode = if covered == toCover(n.sons[0].typ): hasElse = true else: - localError(c.config, n.info, "not all cases covered") + localError(c.config, n.info, "not all cases are covered") closeScope(c) if isEmptyType(typ) or typ.kind in {tyNil, tyExpr} or not hasElse: for i in 1..n.len-1: discardCheck(c, n.sons[i].lastSon) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 52afce688..8b5c26f99 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -447,7 +447,7 @@ proc semTuple(c: PContext, n: PNode, prev: PType): PType = field.position = counter inc(counter) if containsOrIncl(check, field.name.id): - localError(c.config, a.sons[j].info, "attempt to redefine: " & field.name.s) + localError(c.config, a.sons[j].info, "attempt to redefine: '" & field.name.s & "'") else: addSon(result.n, newSymNode(field)) addSonSkipIntLit(result, typ) @@ -682,7 +682,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var IntSet, pos: var int, f.flags = f.flags + ({sfImportc, sfExportc} * fieldOwner.flags) inc(pos) if containsOrIncl(check, f.name.id): - localError(c.config, n.sons[i].info, "attempt to redefine: " & f.name.s) + localError(c.config, n.sons[i].info, "attempt to redefine: '" & f.name.s & "'") if a.kind == nkEmpty: addSon(father, newSymNode(f)) else: addSon(a, newSymNode(f)) styleCheckDef(f) @@ -692,7 +692,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var IntSet, pos: var int, # inherited from generic/partial specialized parent second check. # There is no branch validity check here if containsOrIncl(check, n.sym.name.id): - localError(c.config, n.info, "attempt to redefine: " & n.sym.name.s) + localError(c.config, n.info, "attempt to redefine: '" & n.sym.name.s & "'") addSon(father, n) of nkEmpty: discard else: illFormedAst(n, c.config) @@ -1058,7 +1058,7 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode, inc(counter) if def != nil and def.kind != nkEmpty: arg.ast = copyTree(def) if containsOrIncl(check, arg.name.id): - localError(c.config, a.sons[j].info, "attempt to redefine: " & arg.name.s) + localError(c.config, a.sons[j].info, "attempt to redefine: '" & arg.name.s & "'") addSon(result.n, newSymNode(arg)) rawAddSon(result, finalType) addParamOrResult(c, arg, kind) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 4fdc74373..61d92bb19 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -243,7 +243,7 @@ proc lookupTypeVar(cl: var TReplTypeVars, t: PType): PType = result = cl.typeMap.lookup(t) if result == nil: if cl.allowMetaTypes or tfRetType in t.flags: return - localError(cl.c.config, t.sym.info, "cannot instantiate: " & typeToString(t)) + localError(cl.c.config, t.sym.info, "cannot instantiate: '" & typeToString(t) & "'") result = errorType(cl.c) # In order to prevent endless recursions, we must remember # this bad lookup and replace it with errorType everywhere. @@ -453,7 +453,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType = result.kind = tyUserTypeClassInst of tyGenericBody: - localError(cl.c.config, cl.info, "cannot instantiate: " & typeToString(t)) + localError(cl.c.config, cl.info, "cannot instantiate: '" & typeToString(t) & "'") result = errorType(cl.c) #result = replaceTypeVarsT(cl, lastSon(t)) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 1d4515875..41cac2a4a 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -2365,7 +2365,7 @@ proc instTypeBoundOp*(c: PContext; dc: PSym; t: PType; info: TLineInfo; var m: TCandidate initCandidate(c, m, dc.typ) if col >= dc.typ.len: - localError(c.config, info, "cannot instantiate '" & dc.name.s & "'") + localError(c.config, info, "cannot instantiate: '" & dc.name.s & "'") return nil var f = dc.typ.sons[col] @@ -2374,7 +2374,7 @@ proc instTypeBoundOp*(c: PContext; dc: PSym; t: PType; info: TLineInfo; else: if f.kind == tyVar: f = f.lastSon if typeRel(m, f, t) == isNone: - localError(c.config, info, "cannot instantiate '" & dc.name.s & "'") + localError(c.config, info, "cannot instantiate: '" & dc.name.s & "'") else: result = c.semGenerateInstance(c, dc, m.bindings, info) if op == attachedDeepCopy: diff --git a/compiler/types.nim b/compiler/types.nim index 9c2ad71c5..b5f4fbf54 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1640,7 +1640,7 @@ proc typeMismatch*(conf: ConfigRef; info: TLineInfo, formal, actual: PType) = let x = if named == desc: named else: named & " = " & desc var msg = "type mismatch: got <" & typeToString(actual) & "> " & - "but expected " & x & "'" + "but expected '" & x & "'" if formal.kind == tyProc and actual.kind == tyProc: case compatibleEffects(formal, actual) diff --git a/tests/controlflow/tstatret.nim b/tests/controlflow/tstatret.nim index d655f5595..04cac9966 100644 --- a/tests/controlflow/tstatret.nim +++ b/tests/controlflow/tstatret.nim @@ -1,7 +1,7 @@ discard """ file: "tstatret.nim" line: 9 - errormsg: "statement not allowed after" + errormsg: "unreachable statement after 'return'" """ # no statement after return proc main() = diff --git a/tests/errmsgs/tinvalidinout.nim b/tests/errmsgs/tinvalidinout.nim index ce7eb6022..1fa3805ee 100644 --- a/tests/errmsgs/tinvalidinout.nim +++ b/tests/errmsgs/tinvalidinout.nim @@ -1,10 +1,10 @@ discard """ cmd: "nim check $file" -errormsg: "The `in` modifier can be used only with imported types" +errormsg: "the 'in' modifier can be used only with imported types" nimout: ''' -tinvalidinout.nim(14, 7) Error: The `out` modifier can be used only with imported types -tinvalidinout.nim(17, 9) Error: The `in` modifier can be used only with imported types -tinvalidinout.nim(18, 9) Error: The `in` modifier can be used only with imported types +tinvalidinout.nim(14, 7) Error: the 'out' modifier can be used only with imported types +tinvalidinout.nim(17, 9) Error: the 'in' modifier can be used only with imported types +tinvalidinout.nim(18, 9) Error: the 'in' modifier can be used only with imported types ''' """ diff --git a/tests/lexer/tunderscores.nim b/tests/lexer/tunderscores.nim index e718fb40a..f64f36977 100644 --- a/tests/lexer/tunderscores.nim +++ b/tests/lexer/tunderscores.nim @@ -1,7 +1,7 @@ discard """ file: "tunderscores.nim" line: 8 - errormsg: "invalid token: _" + errormsg: "invalid token: trailing underscore" """ # Bug #502670 diff --git a/tests/misc/tunsignedmisc.nim b/tests/misc/tunsignedmisc.nim index 4b8157ddd..fc02eee19 100644 --- a/tests/misc/tunsignedmisc.nim +++ b/tests/misc/tunsignedmisc.nim @@ -1,5 +1,5 @@ discard """ - errormsg: "number 0x123'u8 out of valid range" + errormsg: "number out of range: '0x123'u8'" """ # Bug #1179 diff --git a/tests/objvariant/temptycaseobj.nim b/tests/objvariant/temptycaseobj.nim index 5c012746e..53171e054 100644 --- a/tests/objvariant/temptycaseobj.nim +++ b/tests/objvariant/temptycaseobj.nim @@ -1,6 +1,6 @@ discard """ line: 11 - errormsg: "identifier expected, but found 'keyword of'" + errormsg: "identifier expected, but got 'keyword of'" """ type diff --git a/tests/parser/tinvcolonlocation1.nim b/tests/parser/tinvcolonlocation1.nim index cacde48bd..2fddab2f8 100644 --- a/tests/parser/tinvcolonlocation1.nim +++ b/tests/parser/tinvcolonlocation1.nim @@ -1,8 +1,8 @@ discard """ file: "tinvcolonlocation1.nim" line: 8 - column: 3 - errormsg: "':' expected" + column: 7 + errormsg: "expected: ':', but got: 'echo'" """ try #<- missing ':' echo "try" diff --git a/tests/parser/tinvcolonlocation2.nim b/tests/parser/tinvcolonlocation2.nim index 2b6a92b9d..4251598b9 100644 --- a/tests/parser/tinvcolonlocation2.nim +++ b/tests/parser/tinvcolonlocation2.nim @@ -1,8 +1,8 @@ discard """ file: "tinvcolonlocation2.nim" line: 11 - column: 1 - errormsg: "':' expected" + column: 8 + errormsg: "expected: ':', but got: 'keyword finally'" """ try: echo "try" diff --git a/tests/parser/tinvcolonlocation3.nim b/tests/parser/tinvcolonlocation3.nim index 2b30b1dbe..a8db658eb 100644 --- a/tests/parser/tinvcolonlocation3.nim +++ b/tests/parser/tinvcolonlocation3.nim @@ -1,8 +1,8 @@ discard """ file: "tinvcolonlocation3.nim" line: 12 - column: 3 - errormsg: "':' expected" + column: 7 + errormsg: "expected: ':', but got: 'echo'" """ try: echo "try" diff --git a/tests/parser/twhen_in_enum.nim b/tests/parser/twhen_in_enum.nim index d4a3ea56a..3890b686e 100644 --- a/tests/parser/twhen_in_enum.nim +++ b/tests/parser/twhen_in_enum.nim @@ -1,5 +1,5 @@ discard """ - errormsg: "identifier expected, but found 'keyword when'" + errormsg: "identifier expected, but got 'keyword when'" """ # bug #2123 diff --git a/tests/types/tparameterizedparent3.nim b/tests/types/tparameterizedparent3.nim index 3fc83cb4d..58aaf80ea 100644 --- a/tests/types/tparameterizedparent3.nim +++ b/tests/types/tparameterizedparent3.nim @@ -1,7 +1,7 @@ discard """ file: "tparameterizedparent3.nim" line: 13 - errormsg: "redefinition of 'color'" + errormsg: "attempt to redefine: 'color'" """ # bug #5264 type diff --git a/tests/types/tparameterizedparent4.nim b/tests/types/tparameterizedparent4.nim index fa8b525c1..a37461bb4 100644 --- a/tests/types/tparameterizedparent4.nim +++ b/tests/types/tparameterizedparent4.nim @@ -1,7 +1,7 @@ discard """ file: "tparameterizedparent4.nim" line: 23 - errormsg: "redefinition of 'grain'" + errormsg: "attempt to redefine: 'grain'" """ # bug #5264 type |