-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Class cast exception when creating a new 2.13-defined class accepting a by-name parameter #16351
Comments
Bisecting using nightlies, it seems the regression happened between |
Standalone reproduction:
//> using scala "2.13.10"
//> using publish.organization "local.debug"
//> using publish.name "scala-2-lib"
//> using publish.version "0.1.0"
package lib
class Value(val value: String)
class Lib(
value: => Value,
a: Int = 0,
b: Int
)
//> using scala "3.2.1"
//> using lib "local.debug:scala-2-lib_2.13:0.1.0"
package app
import lib.*
object App {
def main(args: Array[String]): Unit =
new Lib(Value("Foo"), b = 2) {}
} Publish the Scala 2 library locally:
Run the Scala 3 app:
|
could be #14919? |
I tried this standalone without a publishing step (i.e. compile Lib, compile App) and it ran OK. So not sure what goes on here. EDIT: Ah, sorry, I see now that lib needs to be compiled with Scala 2.13. Now I can repoduce. |
This needs follow up but I don't have the time. - figure out why we crash and what is the right fix - fix the test to compile lib with 2.13 Fixes scala#16531 (provisionally)
This needs follow up but I don't have the time. - figure out why we crash and what is the right fix - fix the test to compile lib with 2.13 Fixes scala#16531 (provisionally)
Compiler version
3.2.1
(3.2.0
also suffers from this, but not3.1.3
)Minimized code
(Edit: fully standalone reproduction in comment below)
Can be reproduced with Scala CLI. In
Test.scala
:I've not been able to reproduce that without using those Ammonite classes yet.Output
Running it:
Expectation
No crash at runtime
Note that running this with Scala
3.1.3
requires slightly different dependencies. The header needs to be changed toThe text was updated successfully, but these errors were encountered: