We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Problem observed on 3.3.1. The problem started with 3.1.2, whereas 3.1.1 works fine. (according to scastie)
trait Printable { def pprint(v: () => String): Unit = { println(v()) } } extension (ctx: Printable) def pprint(f: () => Int): Unit = { ctx.pprint(() => f().toString) } val x = new Printable {} def test = x.pprint(() => "hello") // ok x.pprint(() => { "hello" }) // ok x.pprint(() => 123) // ok x.pprint(() => ( 123 )) // ok x.pprint(() => { 123 }) // FAIL
https://scastie.scala-lang.org/ShYSWt7NSnusCJKuCu8OOw
In Scala 3.3.1 and as early as 3.1.2, this line: x.pprint(() => { 123 }) causes compiler error:
x.pprint(() => { 123 })
Found: (123 : Int) Required: String
Whereas in Scala 3.1.1, that line compiles fine.
x.pprint(() => { 123 }) should compile, consistently with other similar usages shown in the code snippet.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Compiler version
Problem observed on 3.3.1. The problem started with 3.1.2, whereas 3.1.1 works fine. (according to scastie)
Minimized code
https://scastie.scala-lang.org/ShYSWt7NSnusCJKuCu8OOw
Output
In Scala 3.3.1 and as early as 3.1.2, this line:
x.pprint(() => { 123 })
causes compiler error:Whereas in Scala 3.1.1, that line compiles fine.
Expectation
x.pprint(() => { 123 })
should compile, consistently with other similar usages shown in the code snippet.The text was updated successfully, but these errors were encountered: