this is a regression due to #5141. Before, derived trees for valdefs would be rewritten to have their modifiers reflect that the underlying field is private[this]. After the fields rewrite, this is only done for the modifiers tracked by the tree's symbol. When you call untypecheck, the tree's symbol is dropped and thus it forgets that it's supposed to be private[this].
Logged a ticket to be fixed for 2.12.1.
The text was updated successfully, but these errors were encountered:
@retronym said:
This affects regular typechecking, not just macros.
classC {
defc(a: Any, b: Any*) = a
}
objectTest {
newC().c(b =new { valx=42 }, a =0)
}
⚡ ~/scala/2.12.0-RC1/bin/scalac sandbox/test.scala
sandbox/test.scala:5: error: x is already defined as value x
new C().c(b = new { val x = 42 }, a = 0)
^
Reported in https://groups.google.com/d/msg/scala-internals/35uGsuIEnDQ/cj6AtfbfBAAJ
this is a regression due to #5141. Before, derived trees for valdefs would be rewritten to have their modifiers reflect that the underlying field is private[this]. After the fields rewrite, this is only done for the modifiers tracked by the tree's symbol. When you call untypecheck, the tree's symbol is dropped and thus it forgets that it's supposed to be private[this].
Logged a ticket to be fixed for 2.12.1.
The text was updated successfully, but these errors were encountered: