diff options
author | Enno Runne <enno.runne@baymarkets.com> | 2017-02-16 21:11:16 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2017-02-20 16:50:09 +0100 |
commit | 4352a4a97817edfbd4e936258050c17bfff187c3 (patch) | |
tree | 3f86b6109f6db6ccf718758bc040527f76afb556 /compiler/src/dotty/tools/dotc/reporting | |
parent | e668fd7eaf93a81d0409728664a0f2bda4a63761 (diff) | |
download | dotty-4352a4a97817edfbd4e936258050c17bfff187c3.tar.gz dotty-4352a4a97817edfbd4e936258050c17bfff187c3.tar.bz2 dotty-4352a4a97817edfbd4e936258050c17bfff187c3.zip |
Incorporated comments from @felixmulder
Diffstat (limited to 'compiler/src/dotty/tools/dotc/reporting')
-rw-r--r-- | compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala | 15 |
1 files changed, 8 insertions, 7 deletions
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 } |