summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-05-14 21:38:18 +0200
committerAraq <rumpf_a@web.de>2018-05-14 21:38:18 +0200
commit02b78d3f94225ab1b204191d0fb199125787f31d (patch)
tree03c3a5595edf56c8d219c92fec14358c1bf76d69 /compiler
parent5526252fa0218816c3ca5399a7cb927d9b2bbdc4 (diff)
downloadNim-02b78d3f94225ab1b204191d0fb199125787f31d.tar.gz
make tests green again
Diffstat (limited to 'compiler')
-rw-r--r--compiler/parser.nim2
-rw-r--r--compiler/semcall.nim4
-rw-r--r--compiler/seminst.nim4
-rw-r--r--compiler/sempass2.nim2
-rw-r--r--compiler/semstmts.nim2
-rw-r--r--compiler/semtypes.nim8
-rw-r--r--compiler/semtypinst.nim4
-rw-r--r--compiler/sigmatch.nim4
-rw-r--r--compiler/types.nim2
9 files changed, 16 insertions, 16 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)