We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I discovered strange behavior of updateDynamic. I trying to compile following code:
import language.dynamics class DynamicTest extends Dynamic { def selectDynamic(name: String) = s"value of $name" def updateDynamic(name: String)(value: Any) { println(s"You have just updated property '$name' with value: $value") } } object MyApp extends App { def testing() { val test = new DynamicTest test.firstName = "John" } testing() }
Which produces following compilation error:
# scalac MyApp.scala MyApp.scala:13: error: reassignment to val test.firstName = "John" ^ one error found
If I will remove selectDynamic method from the DynamicTest I will receive another error: "error: value selectDynamic is not a member of DynamicTest".
If I will define MyApp class like this:
object MyApp extends App { val test = new DynamicTest test.firstName = "John" }
Then everything compiles without any errors.
BTW, I'm facing the same errors in the REPL.
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-5726?orig=1 Reporter: Oleg Ilyenko (oleg.ilyenko) Affected Versions: 2.10.0-M3 Other Milestones: 2.10.0
Sorry, something went wrong.
@paulp said: scala/scala#1681
@retronym said: scala/scala@edbcc64
paulp
No branches or pull requests
I discovered strange behavior of updateDynamic. I trying to compile following code:
Which produces following compilation error:
If I will remove selectDynamic method from the DynamicTest I will receive another error: "error: value selectDynamic is not a member of DynamicTest".
If I will define MyApp class like this:
Then everything compiles without any errors.
BTW, I'm facing the same errors in the REPL.
The text was updated successfully, but these errors were encountered: