Skip to content

"given inline" error message is misleading #12348

@adamw

Description

@adamw

Compiler version

3.0.0-RC3

Minimized example

object A {
  given inline x: Int = 0
}

Output

[error] -- Error: Test.scala:19:15 
[error] 19 |  given inline x: Int = 0
[error]    |               ^
[error]    |               anonymous given cannot be abstract
[error] -- [E067] Syntax Error: Test.scala:19:8 
[error] 19 |  given inline x: Int = 0
[error]    |        ^
[error]    |Declaration of given instance given_inline not allowed here: only classes can have declared but undefined members
[error] two errors found
[error] two errors found

Expectation

The correct order of given & inline is: inline given. I'd expect the compiler to give a better error message, indicating how to fix the problem.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions