From 4352a4a97817edfbd4e936258050c17bfff187c3 Mon Sep 17 00:00:00 2001 From: Enno Runne Date: Thu, 16 Feb 2017 21:11:16 +0100 Subject: Incorporated comments from @felixmulder --- .../dotty/tools/dotc/reporting/diagnostic/messages.scala | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/reporting') diff --git a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala index f8222ce92..ed1c5642f 100644 --- a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala @@ -1098,20 +1098,21 @@ object messages { val kind = "Syntax" val op1Asso = if (op2LeftAssoc) "which is right-associative" else "which is left-associative" val op2Asso = if (op2LeftAssoc) "which is left-associative" else "which is right-associative" - val msg = s"${hl"`${op1}`"} (${op1Asso}) and ${hl"`${op2}`"} ($op2Asso) have same precedence and may not be mixed" + val msg = s"`${op1}` (${op1Asso}) and `${op2}` ($op2Asso) have same precedence and may not be mixed" val explanation = - s"""|The operators ${hl"${op1}"} and ${hl"${op2}"} are used as infix operators in the same expression, + s"""|The operators ${op1} and ${op2} are used as infix operators in the same expression, |but they bind to different sides: - |${hl"${op1}"} is applied to the operand to its ${if (op2LeftAssoc) "right" else "left"} - |${hl"${op2}"} is applied to the operand to its ${if (op2LeftAssoc) "left" else "right"} + |${op1} is applied to the operand to its ${if (op2LeftAssoc) "right" else "left"} + |${op2} is applied to the operand to its ${if (op2LeftAssoc) "left" else "right"} |As both have the same precedence the compiler can't decide which to apply first. | |You may use parenthesis to make the application order explicit, - |or use method application syntax ${hl"`operand1.${op1}(operand2)`"}. + |or use method application syntax `operand1.${op1}(operand2)`. | |Operators ending in a colon `:` are right-associative. All other operators are left-associative. | - |Infix operator precedence is determined by the operator's first character: + |Infix operator precedence is determined by the operator's first character. Characters are listed + |below in increasing order of precedence, with characters on the same line having the same precedence. | (all letters) | | | ^ @@ -1122,7 +1123,7 @@ object messages { | + - | * / % | (all other special characters) - |Operators starting with a letter have lowest precedence, followed by operators starting with `|', etc. + |Operators starting with a letter have lowest precedence, followed by operators starting with `|`, etc. |""".stripMargin } -- cgit v1.2.3