Open griggt opened 3 years ago
Minimized to
import scala.reflect.Selectable.reflectiveSelectable
type Runner = { def run(args: Array[String]): Unit }
def test(runner: Runner): Unit = runner.run(???)
The issue is that now we generate a classOf[String[]]
instead of classOf[Array[String]]
.
@sjrd, why did you use erased types in 574f741? Could we potentially use non erased types and let eraser take care of them?
Because I didn't know how to, in particular what to do when you need to conjure up a concrete type valid as call site when your definition site as T
where T >: A <: B
with more or less arbitrary bounds?
What are you looking for exactly? If you need an applied class type which is a supertype of some arbitrary myType
, then try myType.baseType(myType.classSymbol)
.
Is there any update on this issue? I'm seeing the same problem with the 3.3.0 compiler and just wondering if I should use the workaround or wait for a fix.
potential spree candidate? @mbovel
Minimized code
Output (click arrow to expand)
Expectation
Successful compilation and when run prints:
Workaround
Notes
Works as expected in 3.0.0-M1 and 2.13.4. The regression appears to be caused by 574f74103397ed733b2ed30d88ada829ec2666af.
https://github.com/lampepfl/dotty/blob/574f74103397ed733b2ed30d88ada829ec2666af/compiler/src/dotty/tools/dotc/typer/Dynamic.scala#L221-L226