-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Weird case of double-parentheses impacting type inference in List.apply #10062
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
Comments
Scala 2 doesn't fare as well with |
@som-snytt class X
object App extends App {
val test = List(null: X)
println(test)
} Is your repl printout from 2.12? |
Sorry I didn't add commentary. It's I was curious why it says The other point was that the error here happens on |
Fix #10062: Avoid bad case during typing
Minimized code
https://scastie.scala-lang.org/He9Pm96ySZCBCziHLktlXg
Output
Error:
Expectation
Should compile. If a redundant second set of parentheses is added in
List((null: X))
, then the example compiles:https://scastie.scala-lang.org/dwFH7NAsQyqKpoXHuzAWiA
The text was updated successfully, but these errors were encountered: