Skip to content

Commit a415bdc

Browse files
committed
Fix backting if ending with operator part
1 parent d11dce4 commit a415bdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ object Parsers {
793793
patchOver(source, Span(startClosing, endClosing), "")
794794
if colonRequired then
795795
// add backticks around operator and add colon
796-
if lastSaved.isOperator then
796+
if lastSaved.token == IDENTIFIER && Chars.isOperatorPart(lastSaved.name.last) then
797797
patch(Span(lastSaved.offset, lastSaved.offset + lastSaved.name.length), s"`${lastSaved.name}` :")
798798
else patch(Span(lastOffsetSaved), ":")
799799
else

0 commit comments

Comments
 (0)