File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
3434 case defn.ArrayOf (elemTp) =>
3535 val etag = typer.inferImplicitArg(defn.ClassTagClass .typeRef.appliedTo(elemTp), span)
3636 if etag.tpe.isError then EmptyTree else etag.select(nme.wrap)
37- case tp if hasStableErasure(tp) && ! defn.isBottomClassAfterErasure( tp.typeSymbol) =>
37+ case tp if hasStableErasure(tp) && ! tp.isBottomTypeAfterErasure =>
3838 val sym = tp.typeSymbol
3939 val classTagModul = ref(defn.ClassTagModule )
4040 if defn.SpecialClassTagClasses .contains(sym) then
Original file line number Diff line number Diff line change 1+ import scala .reflect .ClassTag
2+
3+ @ main def Test =
4+ val x : Array [? <: String ] = Array [Int & Nothing ]() // error: No ClassTag available for Int & Nothing
5+ // (was: ClassCastException: [I cannot be cast to [Ljava.lang.String)
6+ val y : Array [? <: Int ] = Array [String & Nothing ]() // error: No ClassTag available for String & Nothing
7+ // (was: ClassCastException: [Lscala.runtime.Nothing$; cannot be cast to [I)
You can’t perform that action at this time.
0 commit comments