Skip to content

Commit

Permalink
Fix backting if ending with operator part
Browse files Browse the repository at this point in the history
  • Loading branch information
adpi2 committed May 29, 2023
1 parent d11dce4 commit a415bdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ object Parsers {
patchOver(source, Span(startClosing, endClosing), "")
if colonRequired then
// add backticks around operator and add colon
if lastSaved.isOperator then
if lastSaved.token == IDENTIFIER && Chars.isOperatorPart(lastSaved.name.last) then
patch(Span(lastSaved.offset, lastSaved.offset + lastSaved.name.length), s"`${lastSaved.name}` :")
else patch(Span(lastOffsetSaved), ":")
else
Expand Down

0 comments on commit a415bdc

Please sign in to comment.