Error message ranges related to @unroll annotation are confusing #23072
Labels
area:experimental:unroll
Issues tied to the @unroll annotation
area:ux
Issues tied to user experience.
itype:bug
I extracted it from the #21693 comments
Compiler version
Scala 3.7.0-RC4
I played around the with the
@unroll
annotation and I find the error message ranges confusingExample 0
"Cannot unroll method foo in class Example at line 5 because parameter z needs a default value"
The error is specific to a single parameter.
The whole parameter range is highlighted - OK, seems no issue.
Example 1
"Cannot unroll parameters of method foo: it is not final"
The error is specific to the whole function and the @unroll annotation usage fact.
However, the range here is the parameter name identifier, which looks strange.
Nothing in the parameter
z
is special here, so I suppose the better range to highlight here would be just@unroll
annotationExample 2
"@unroll is only allowed on a method parameter"
It's shown on the name identifier
foo
.To me it seems the
@unroll
annotation itself would be a better fit here as well - it's the annotation to blame, not the definition name identifier.Note that the error at
@unroll
is different:The text was updated successfully, but these errors were encountered: