We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Scalac is happy to compile the code below:
object Test { trait Gen[T] { def map[U](f: T => U): Gen[U] = ??? } def f[T](implicit g: Gen[T]): Gen[() => T] = g map ( () => _ ) }
whereas dotty fails with:
-- Error: local/func0.scala ---------------------------------------------------- 8 | g map ( () => _ ) | ^ | missing parameter type for parameter _$1, expected = Test.Gen[() => T]
The text was updated successfully, but these errors were encountered:
dotty parser:
def f[T](implicit g: Gen[T]): Gen[() => T] = _$1 => g map (() => _$1)
scalac parser:
def f[T](implicit g: Gen[T]): Gen[_root_.scala.Function0[T]] = g.map(((x$1) => (() => x$1)))
Honestly, I would expect this to expand to () => (x => x) but apparently both parsers disagree with me ;)
() => (x => x)
Sorry, something went wrong.
Fix scala#2009: Fix placeholder params logic for lambdas
e3fa6df
Logic was missing placeholders in rhs of lambdas.
@smarter Well spotted! I agree with scalacs parser here 😄
scalac
6eeb06f
No branches or pull requests
Scalac is happy to compile the code below:
whereas dotty fails with:
The text was updated successfully, but these errors were encountered: