Skip to content

Commit f499a1f

Browse files
committed
Use 'reassignment to val' message as error in Dynamic
1 parent e8c1db3 commit f499a1f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Dynamic.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import core.Symbols._
1515
import core.Definitions
1616
import Inferencing._
1717
import ErrorReporting._
18+
import dotty.tools.dotc.reporting.diagnostic.messages.ReassignmentToVal
1819

1920
object Dynamic {
2021
def isDynamicMethod(name: Name): Boolean =
@@ -99,7 +100,7 @@ trait Dynamic { self: Typer with Applications =>
99100
case TypeApply(Select(qual, name), targs) if !isDynamicMethod(name) =>
100101
typedDynamicAssign(qual, name, targs)
101102
case _ =>
102-
errorTree(tree, "reassignment to val")
103+
errorTree(tree, ReassignmentToVal(tree.lhs.symbol.name))
103104
}
104105
}
105106

0 commit comments

Comments
 (0)