Skip to content

Regression in rssh/dotty-cps-async - overload of experimental method #18414

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

Closed
WojciechMazur opened this issue Aug 16, 2023 · 2 comments
Closed
Assignees
Labels
area:experimental area:typer itype:bug regression This worked in a previous version but doesn't anymore source-incompatibility Fixing a bug caused some erronous code to stop compiling. Should be mentioned in the release notes.

Comments

@WojciechMazur
Copy link
Contributor

Based on OpenCB failure in rssh/dotty-cps-async build logs

Since Scala 3.3.1-RC1 we define overloaded versions of defn.FunctionClass which are marked as experimental. The previous method is going to be deprecated in 3.4. However, for the 3.3.x LTS line the source compatibilty is broken when using stable versions of the compiler or when using -Yno-experimental flag.

Compiler version

Since 3.3.1-RC1
After merge of 9571b42

Minimized code

//> using options -Yno-experimental

import scala.quoted._

def repro(using      Quotes): Unit = {
  import quotes.reflect._
  val works = defn.FunctionClass(42, isImplicit = false, isErased = false)
  val fails = defn.FunctionClass(42)
}

Output

[error] ./main.scala:8:15
[error] method FunctionClass is marked @experimental and therefore may only be used in an experimental scope.
[error]   val fails = defn.FunctionClass(42)
[error]        

Expectation

Can we force typer to use non-experimental variant of overloaded function under no-experimental flag (or in stable release)?

@WojciechMazur WojciechMazur added itype:bug area:typer regression This worked in a previous version but doesn't anymore area:experimental source-incompatibility Fixing a bug caused some erronous code to stop compiling. Should be mentioned in the release notes. labels Aug 16, 2023
@Kordyjan Kordyjan self-assigned this Aug 28, 2023
Kordyjan added a commit that referenced this issue Aug 29, 2023
Reverts #16849 on the LTS line.

Introducing new experimental overload with fewer arguments is breaking
source compatibility.

Fixes #18414
@WojciechMazur
Copy link
Contributor Author

@Kordyjan This issue can be probably closed already

@nicolasstucki
Copy link
Contributor

This does work in 3.3.1. It was fixed in #18473. We can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:experimental area:typer itype:bug regression This worked in a previous version but doesn't anymore source-incompatibility Fixing a bug caused some erronous code to stop compiling. Should be mentioned in the release notes.
Projects
None yet
Development

No branches or pull requests

3 participants