We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
-Ycc
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
3.2.1-RC1
class Delta: val value = 1 def f(v: Int)(using delta: Delta): Int = v + delta.value def run(): Unit = val delta = Delta() val x: Map[Char, Int] = Map( 'a' -> 0, 'b' -> 1 ) val y: Map[Char, Int] = x.map((k, v) => (k, f(v)(using delta)))
it doesn't compile when -Ycc is enabled.
[error] 15 | val y: Map[Char, Int] = x.map((k, v) => (k, f(v)(using delta))) [error] | ^^^^^ [error] |None of the overloaded alternatives of method map in trait IterableOps with types [error] | [B](f: ((Char, Int)) => B): scala.collection.immutable.Iterable[B] [error] | [K2, V2](f: ((Char, Int)) => (K2, V2)): Map[K2, V2] [error] |match arguments ((<?>, <?>) -> <?>) [error] one error found
With -Ycc flag, it works fine if we specify the type of parameters:
val y: Map[Char, Int] = x.map((k: Char, v: Int) => (k, f(v)(using delta)))
It works fine when -Ycc is disabled.
It's expected to be compiled when -Ycc is enabled.
The text was updated successfully, but these errors were encountered:
I believe it works now, adding a regression test.
Sorry, something went wrong.
Regression test for scala#16224
5ff6650
Fixes scala#16224
Regression test for #16224 (#18067)
484be60
Fixes #16224
odersky
Successfully merging a pull request may close this issue.
Compiler version
3.2.1-RC1
Minimized code
Output
it doesn't compile when
-Ycc
is enabled.With
-Ycc
flag, it works fine if we specify the type of parameters:It works fine when
-Ycc
is disabled.Expectation
It's expected to be compiled when
-Ycc
is enabled.The text was updated successfully, but these errors were encountered: