Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top-level @experimental val _ = ... not considered experimental #20283

Open
nicolasstucki opened this issue Apr 29, 2024 · 0 comments
Open

Top-level @experimental val _ = ... not considered experimental #20283

nicolasstucki opened this issue Apr 29, 2024 · 0 comments

Comments

@nicolasstucki
Copy link
Contributor

Compiler version

3.4.0, 00802ab

Minimized code

@annotation.experimental
def method(): Unit = ()

@annotation.experimental
val _ = method()

Output

5 |val _ = method() // error but should not
  |        ^^^^^^
  |        method method is marked @experimental
  |
  |        Experimental definition may only be used under experimental mode:
  |          1. in a definition marked as @experimental, or
  |          2. compiling with the -experimental compiler flag, or
  |          3. with a nightly or snapshot version of the compiler.

Expectation

The error should not be emitted. The cause of this issue is the same as in #19807 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant