Skip to content

Commit e3d91dc

Browse files
committed
Fix #8181: Fix isExprIntro predicate to exclude extension on
1 parent 46aec62 commit e3d91dc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ object Parsers {
213213
} && !in.isSoftModifierInModifierPosition
214214

215215
def isExprIntro: Boolean =
216-
in.canStartExprTokens.contains(in.token) && !in.isSoftModifierInModifierPosition
216+
in.canStartExprTokens.contains(in.token)
217+
&& !in.isSoftModifierInModifierPosition
218+
&& !(isIdent(nme.extension) && followingIsExtension())
217219

218220
def isDefIntro(allowedMods: BitSet, excludedSoftModifiers: Set[TermName] = Set.empty): Boolean =
219221
in.token == AT

tests/pos/i8181.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object Main:
2+
def main(args: Array[String]): Unit =
3+
extension on (a: AnyRef):
4+
def putout(): Unit = println(a)
5+
6+
"blub".putout()

0 commit comments

Comments
 (0)