From ace452072be9e19e05be222bea002991dc4299ba Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Mon, 18 Dec 2017 15:26:18 +0000 Subject: [PATCH] Use backticks instead of brackets in error messages --- src/dmd/dinterpret.d | 2 +- src/dmd/expression.d | 10 +++++----- src/dmd/expressionsem.d | 2 +- src/dmd/mtype.d | 2 +- test/fail_compilation/bug9631.d | 2 +- test/fail_compilation/diag12063.d | 2 +- test/fail_compilation/diag16499.d | 4 ++-- test/fail_compilation/diag9398.d | 2 +- test/fail_compilation/diag_err1.d | 2 +- test/fail_compilation/fail11445.d | 2 +- test/fail_compilation/fail209.d | 2 +- test/fail_compilation/fail256.d | 2 +- test/fail_compilation/fail297.d | 2 +- test/fail_compilation/fail3.d | 2 +- test/fail_compilation/fail312.d | 4 ++-- test/fail_compilation/fail54.d | 2 +- test/fail_compilation/fail79.d | 2 +- test/fail_compilation/ice11850.d | 2 +- test/fail_compilation/ice13382.d | 16 ++++++++-------- test/fail_compilation/ice2843.d | 2 +- test/fail_compilation/ice8309.d | 2 +- test/fail_compilation/ice8511.d | 2 +- test/fail_compilation/test16116.d | 2 +- 23 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/dmd/dinterpret.d b/src/dmd/dinterpret.d index a3437eb39f2e..41eaeb6921b7 100644 --- a/src/dmd/dinterpret.d +++ b/src/dmd/dinterpret.d @@ -3246,7 +3246,7 @@ public: if (cmp == -1) { char dir = (e.op == TOKgt || e.op == TOKge) ? '<' : '>'; - e.error("the ordering of pointers to unrelated memory blocks is indeterminate in CTFE. To check if they point to the same memory block, use both > and < inside && or ||, eg (%s && %s %c= %s + 1)", e.toChars(), e.e1.toChars(), dir, e.e2.toChars()); + e.error("the ordering of pointers to unrelated memory blocks is indeterminate in CTFE. To check if they point to the same memory block, use both > and < inside && or ||, eg `%s && %s %c= %s + 1`", e.toChars(), e.e1.toChars(), dir, e.e2.toChars()); result = CTFEExp.cantexp; return; } diff --git a/src/dmd/expression.d b/src/dmd/expression.d index a24b98d97ec8..665d6333136a 100644 --- a/src/dmd/expression.d +++ b/src/dmd/expression.d @@ -4749,11 +4749,11 @@ extern (C++) class UnaExp : Expression if (e1.op == TOKtype) { - error("incompatible type for (%s(%s)): cannot use '%s' with types", Token.toChars(op), e1.toChars(), Token.toChars(op)); + error("incompatible type for `%s(%s)`: cannot use '%s' with types", Token.toChars(op), e1.toChars(), Token.toChars(op)); } else { - error("incompatible type for (%s(%s)): '%s'", Token.toChars(op), e1.toChars(), e1.type.toChars()); + error("incompatible type for `%s(%s)`: '%s'", Token.toChars(op), e1.toChars(), e1.type.toChars()); } return new ErrorExp(); } @@ -4827,18 +4827,18 @@ extern (C++) abstract class BinExp : Expression TOK thisOp = (op == TOKquestion) ? TOKcolon : op; if (e1.op == TOKtype || e2.op == TOKtype) { - error("incompatible types for ((%s) %s (%s)): cannot use '%s' with types", + error("incompatible types for `(%s) %s (%s)`: cannot use '%s' with types", e1.toChars(), Token.toChars(thisOp), e2.toChars(), Token.toChars(op)); } else if (e1.type.equals(e2.type)) { - error("incompatible types for ((%s) %s (%s)): both operands are of type '%s'", + error("incompatible types for `(%s) %s (%s)`: both operands are of type '%s'", e1.toChars(), Token.toChars(thisOp), e2.toChars(), e1.type.toChars()); } else { auto ts = toAutoQualChars(e1.type, e2.type); - error("incompatible types for ((%s) %s (%s)): '%s' and '%s'", + error("incompatible types for `(%s) %s (%s)`: '%s' and '%s'", e1.toChars(), Token.toChars(thisOp), e2.toChars(), ts[0], ts[1]); } return new ErrorExp(); diff --git a/src/dmd/expressionsem.d b/src/dmd/expressionsem.d index db0877948db5..5c058b8e8484 100644 --- a/src/dmd/expressionsem.d +++ b/src/dmd/expressionsem.d @@ -4249,7 +4249,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor } if (p.token.value != TOKeof) { - exp.error("incomplete mixin expression (%s)", se.toChars()); + exp.error("incomplete mixin expression `%s`", se.toChars()); return setError(); } diff --git a/src/dmd/mtype.d b/src/dmd/mtype.d index d97baf45625d..6d59140b2652 100644 --- a/src/dmd/mtype.d +++ b/src/dmd/mtype.d @@ -7010,7 +7010,7 @@ extern (C++) final class TypeTypeof : TypeQualified Type t = exp.type; if (!t) { - error(loc, "expression (%s) has no type", exp.toChars()); + error(loc, "expression `%s` has no type", exp.toChars()); goto Lerr; } if (t.ty == Ttypeof) diff --git a/test/fail_compilation/bug9631.d b/test/fail_compilation/bug9631.d index 867d6c99f160..8cd8799daa48 100644 --- a/test/fail_compilation/bug9631.d +++ b/test/fail_compilation/bug9631.d @@ -23,7 +23,7 @@ void main() /* TEST_OUTPUT: --- -fail_compilation/bug9631.d(41): Error: incompatible types for ((x) == (y)): 'bug9631.S' and 'bug9631.tem!().S' +fail_compilation/bug9631.d(41): Error: incompatible types for `(x) == (y)`: 'bug9631.S' and 'bug9631.tem!().S' --- */ diff --git a/test/fail_compilation/diag12063.d b/test/fail_compilation/diag12063.d index e029810b1dca..d3ebd5bdeb5b 100644 --- a/test/fail_compilation/diag12063.d +++ b/test/fail_compilation/diag12063.d @@ -2,7 +2,7 @@ TEST_OUTPUT: --- fail_compilation/diag12063.d(11): Error: no property 'max' for type 'Foo' -fail_compilation/diag12063.d(14): Error: incompatible types for ((Foo()) + (1)): 'Bar' and 'int' +fail_compilation/diag12063.d(14): Error: incompatible types for `(Foo()) + (1)`: 'Bar' and 'int' --- */ diff --git a/test/fail_compilation/diag16499.d b/test/fail_compilation/diag16499.d index 5d0c6ff581f3..dc5119b2ecba 100644 --- a/test/fail_compilation/diag16499.d +++ b/test/fail_compilation/diag16499.d @@ -1,8 +1,8 @@ /* TEST_OUTPUT: --- -fail_compilation/diag16499.d(22): Error: incompatible types for ((2) in (foo)): 'int' and 'A' -fail_compilation/diag16499.d(24): Error: incompatible types for ((1.00000) in (bar)): 'double' and 'B' +fail_compilation/diag16499.d(22): Error: incompatible types for `(2) in (foo)`: 'int' and 'A' +fail_compilation/diag16499.d(24): Error: incompatible types for `(1.00000) in (bar)`: 'double' and 'B' --- */ diff --git a/test/fail_compilation/diag9398.d b/test/fail_compilation/diag9398.d index 67900c9bc6c5..05af521e8717 100644 --- a/test/fail_compilation/diag9398.d +++ b/test/fail_compilation/diag9398.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/diag9398.d(11): Error: incompatible types for ((f) : (s)): 'float' and 'string' +fail_compilation/diag9398.d(11): Error: incompatible types for `(f) : (s)`: 'float' and 'string' --- */ void main() diff --git a/test/fail_compilation/diag_err1.d b/test/fail_compilation/diag_err1.d index 50e16b437597..ec5a652f6db0 100644 --- a/test/fail_compilation/diag_err1.d +++ b/test/fail_compilation/diag_err1.d @@ -8,7 +8,7 @@ fail_compilation/diag_err1.d(22): Error: undefined identifier `y` fail_compilation/diag_err1.d(22): while evaluating pragma(msg, (x + y).sizeof) fail_compilation/diag_err1.d(23): Error: undefined identifier `x` fail_compilation/diag_err1.d(23): while evaluating pragma(msg, (n += x).sizeof) -fail_compilation/diag_err1.d(24): Error: incompatible types for ((s) ~ (n)): 'string' and 'int' +fail_compilation/diag_err1.d(24): Error: incompatible types for `(s) ~ (n)`: 'string' and 'int' fail_compilation/diag_err1.d(24): while evaluating pragma(msg, (s ~ n).sizeof) --- */ diff --git a/test/fail_compilation/fail11445.d b/test/fail_compilation/fail11445.d index ed3f226e4f20..656404e56fc1 100644 --- a/test/fail_compilation/fail11445.d +++ b/test/fail_compilation/fail11445.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail11445.d(11): Error: incompatible types for ((a) + (b)): both operands are of type 'double[string]' +fail_compilation/fail11445.d(11): Error: incompatible types for `(a) + (b)`: both operands are of type 'double[string]' --- */ diff --git a/test/fail_compilation/fail209.d b/test/fail_compilation/fail209.d index a0211aaf4b44..63d180034fa0 100644 --- a/test/fail_compilation/fail209.d +++ b/test/fail_compilation/fail209.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail209.d(20): Error: incompatible types for ((a) -= (x)): 'float' and 'fail209.X' +fail_compilation/fail209.d(20): Error: incompatible types for `(a) -= (x)`: 'float' and 'fail209.X' --- */ diff --git a/test/fail_compilation/fail256.d b/test/fail_compilation/fail256.d index 87120e2644f6..4d89fb8b8f20 100644 --- a/test/fail_compilation/fail256.d +++ b/test/fail_compilation/fail256.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail256.d(8): Error: incompatible types for (("foo"d) ~ ("bar"c)): 'dstring' and 'string' +fail_compilation/fail256.d(8): Error: incompatible types for `("foo"d) ~ ("bar"c)`: 'dstring' and 'string' --- */ diff --git a/test/fail_compilation/fail297.d b/test/fail_compilation/fail297.d index fd2249db2ca6..4614ce3afa59 100644 --- a/test/fail_compilation/fail297.d +++ b/test/fail_compilation/fail297.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail297.d(30): Error: incompatible types for ((Bar()) + (baz())): 'Bar' and 'const(Bar)' +fail_compilation/fail297.d(30): Error: incompatible types for `(Bar()) + (baz())`: 'Bar' and 'const(Bar)' --- */ diff --git a/test/fail_compilation/fail3.d b/test/fail_compilation/fail3.d index 0b7516cbc06c..7cdb5c3163de 100644 --- a/test/fail_compilation/fail3.d +++ b/test/fail_compilation/fail3.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail3.d(41): Error: incompatible types for ((a) + (b)): both operands are of type 'vec2' +fail_compilation/fail3.d(41): Error: incompatible types for `(a) + (b)`: both operands are of type 'vec2' --- */ diff --git a/test/fail_compilation/fail312.d b/test/fail_compilation/fail312.d index 3823ee414c5a..a4e059498882 100644 --- a/test/fail_compilation/fail312.d +++ b/test/fail_compilation/fail312.d @@ -1,8 +1,8 @@ /* TEST_OUTPUT: --- -fail_compilation/fail312.d(13): Error: incompatible types for ((a[]) == (b)): 'int[]' and 'short' -fail_compilation/fail312.d(14): Error: incompatible types for ((a[]) <= (b)): 'int[]' and 'short' +fail_compilation/fail312.d(13): Error: incompatible types for `(a[]) == (b)`: 'int[]' and 'short' +fail_compilation/fail312.d(14): Error: incompatible types for `(a[]) <= (b)`: 'int[]' and 'short' --- */ diff --git a/test/fail_compilation/fail54.d b/test/fail_compilation/fail54.d index aa95b1d15d68..fc17acb6cee2 100644 --- a/test/fail_compilation/fail54.d +++ b/test/fail_compilation/fail54.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail54.d(22): Error: incompatible types for ((0) == (Exception)): cannot use '==' with types +fail_compilation/fail54.d(22): Error: incompatible types for `(0) == (Exception)`: cannot use '==' with types --- */ diff --git a/test/fail_compilation/fail79.d b/test/fail_compilation/fail79.d index da06984e9ef0..d3556594cb80 100644 --- a/test/fail_compilation/fail79.d +++ b/test/fail_compilation/fail79.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail79.d(13): Error: incompatible types for ((& a) + (& b)): both operands are of type 'int*' +fail_compilation/fail79.d(13): Error: incompatible types for `(& a) + (& b)`: both operands are of type 'int*' --- */ diff --git a/test/fail_compilation/ice11850.d b/test/fail_compilation/ice11850.d index 9d1f172a50e3..6acb0ecd4cca 100644 --- a/test/fail_compilation/ice11850.d +++ b/test/fail_compilation/ice11850.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/ice11850.d(14): Error: incompatible types for ((a) < ([0])): 'uint[]' and 'int[]' +fail_compilation/ice11850.d(14): Error: incompatible types for `(a) < ([0])`: 'uint[]' and 'int[]' fail_compilation/imports/a11850.d(9): instantiated from here: FilterResult!(__lambda1, uint[][]) fail_compilation/ice11850.d(14): instantiated from here: filter!(uint[][]) --- diff --git a/test/fail_compilation/ice13382.d b/test/fail_compilation/ice13382.d index e5f1ac0f3f9a..c4cfa0fe9c3d 100644 --- a/test/fail_compilation/ice13382.d +++ b/test/fail_compilation/ice13382.d @@ -1,14 +1,14 @@ /* TEST_OUTPUT: --- -fail_compilation/ice13382.d(18): Error: incompatible types for ((a) == (0)): 'int[]' and 'int' -fail_compilation/ice13382.d(19): Error: incompatible types for ((a) >= (0)): 'int[]' and 'int' -fail_compilation/ice13382.d(20): Error: incompatible types for ((0) == (a)): 'int' and 'int[]' -fail_compilation/ice13382.d(21): Error: incompatible types for ((0) >= (a)): 'int' and 'int[]' -fail_compilation/ice13382.d(22): Error: incompatible types for ((a) is (0)): 'int[]' and 'int' -fail_compilation/ice13382.d(23): Error: incompatible types for ((a) !is (0)): 'int[]' and 'int' -fail_compilation/ice13382.d(24): Error: incompatible types for ((0) is (a)): 'int' and 'int[]' -fail_compilation/ice13382.d(25): Error: incompatible types for ((0) !is (a)): 'int' and 'int[]' +fail_compilation/ice13382.d(18): Error: incompatible types for `(a) == (0)`: 'int[]' and 'int' +fail_compilation/ice13382.d(19): Error: incompatible types for `(a) >= (0)`: 'int[]' and 'int' +fail_compilation/ice13382.d(20): Error: incompatible types for `(0) == (a)`: 'int' and 'int[]' +fail_compilation/ice13382.d(21): Error: incompatible types for `(0) >= (a)`: 'int' and 'int[]' +fail_compilation/ice13382.d(22): Error: incompatible types for `(a) is (0)`: 'int[]' and 'int' +fail_compilation/ice13382.d(23): Error: incompatible types for `(a) !is (0)`: 'int[]' and 'int' +fail_compilation/ice13382.d(24): Error: incompatible types for `(0) is (a)`: 'int' and 'int[]' +fail_compilation/ice13382.d(25): Error: incompatible types for `(0) !is (a)`: 'int' and 'int[]' --- */ diff --git a/test/fail_compilation/ice2843.d b/test/fail_compilation/ice2843.d index c0c379767e1b..11da4fc73079 100644 --- a/test/fail_compilation/ice2843.d +++ b/test/fail_compilation/ice2843.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/ice2843.d(22): Error: incompatible types for ((1) is (typeid(int))): 'int' and 'object.TypeInfo' +fail_compilation/ice2843.d(22): Error: incompatible types for `(1) is (typeid(int))`: 'int' and 'object.TypeInfo' --- */ diff --git a/test/fail_compilation/ice8309.d b/test/fail_compilation/ice8309.d index 5d5bb83298d5..a405b21b6b15 100644 --- a/test/fail_compilation/ice8309.d +++ b/test/fail_compilation/ice8309.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/ice8309.d(10): Error: incompatible types for ((__lambda1) : (__lambda2)): 'double function() pure nothrow @nogc @safe' and 'int function() pure nothrow @nogc @safe' +fail_compilation/ice8309.d(10): Error: incompatible types for `(__lambda1) : (__lambda2)`: 'double function() pure nothrow @nogc @safe' and 'int function() pure nothrow @nogc @safe' --- */ diff --git a/test/fail_compilation/ice8511.d b/test/fail_compilation/ice8511.d index 873f8965ec27..04827f13ced9 100644 --- a/test/fail_compilation/ice8511.d +++ b/test/fail_compilation/ice8511.d @@ -2,7 +2,7 @@ TEST_OUTPUT: --- fail_compilation/ice8511.d(11): Error: enum ice8511.hypot.SQRTMAX is forward referenced looking for base type -fail_compilation/ice8511.d(12): Error: incompatible types for ((SQRTMAX) / (2)): cannot use '/' with types +fail_compilation/ice8511.d(12): Error: incompatible types for `(SQRTMAX) / (2)`: cannot use '/' with types --- */ diff --git a/test/fail_compilation/test16116.d b/test/fail_compilation/test16116.d index be6e7868960c..7f53f4352bbf 100644 --- a/test/fail_compilation/test16116.d +++ b/test/fail_compilation/test16116.d @@ -3,7 +3,7 @@ REQUIRED_ARGS: -m64 PERMUTE_ARGS: TEST_OUTPUT: --- -fail_compilation/test16116.d(15): Error: incompatible types for ((v) * (i)): '__vector(short[8])' and 'int' +fail_compilation/test16116.d(15): Error: incompatible types for `(v) * (i)`: '__vector(short[8])' and 'int' --- */