-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Closed
Copy link
Labels
SpreeSuitable for a future SpreeSuitable for a future Spreearea:experimentalarea:experimental:unrollIssues tied to the @unroll annotationIssues tied to the @unroll annotationitype:bug
Milestone
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
Metadata
Metadata
Assignees
Labels
SpreeSuitable for a future SpreeSuitable for a future Spreearea:experimentalarea:experimental:unrollIssues tied to the @unroll annotationIssues tied to the @unroll annotationitype:bug