Closed
Description
Compiler version
3.7.0-RC1
Minimized code
final class Foo{
def bar(@scala.annotation.unroll x: Int = 0) = x + 1
}
Output
[44] [error] -- [E207] Declaration Error: /Users/lihaoyi/test/src/test.scala:2:35 -----------
[44] [error] 2 | def bar(@scala.annotation.unroll x: Int = 0) = x + 1
[44] [error] | ^
[44] [error] | Cannot unroll parameters of method bar: it is not final
[44] [error] one error found
Expectation
@unroll
should be able to see that the enclosing Foo
is a final class
, and thus allow us to elide final
modifiers on the def bar
. It already recognizes enclosing object
s as final
, so recognizing enclosing final class
and final case class
es is a straightforward extension