-
Notifications
You must be signed in to change notification settings - Fork 1.1k
BoxedUnit cannot be cast to class scala.Function0 #14700
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
I can't reproduce this in 3.1.2-RC2. |
It only happens on main, seems to be a result of #14295 |
Thanks, I was just about to identify a commit. |
It only happens in the repl of main as far as I can see. The following program works as expected: object l1:
def g(args: Int*)(block: => Unit): Unit = println(s"Well, ${args.sum} and $block")
object l2:
import l1.*
def f = g()
@main def Test =
import l1.*
import l2.*
f(println("x")) |
I confirmed it also compiles under separate compilation, so I'll try to see what's wrong with REPL. |
I picked this up. I'll try to PR before it catches odersky's attention. It's only the REPL. Currently, with
Until now, I compared various permutations, but forgot to ask if it works twice, a classic question for resident compiler. First time,
where erasure is too boxy. Second time, elimByName sits on the bench.
scalac says
Also scalac under some regime:
|
Compiler version
Minimized code
Expectation
The text was updated successfully, but these errors were encountered: