Skip to content

method override acts as escape hatch for @experimental #17291

Open
@bishabosha

Description

@bishabosha

Compiler version

3.3.0-RC3

Minimized code

import annotation.experimental

trait Foo { @experimental def bar = 23 }

object Bar extends Foo { override def bar = 42 }

@main def Test = println(Bar.bar)

Output

42

Expectation

I expected an error at the use site of Bar.bar.

Perhaps also we should error at the definition when overriding experimental definitions to also add experimental.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions