File tree 2 files changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/typer
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):
34
34
case defn.ArrayOf (elemTp) =>
35
35
val etag = typer.inferImplicitArg(defn.ClassTagClass .typeRef.appliedTo(elemTp), span)
36
36
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 =>
38
38
val sym = tp.typeSymbol
39
39
val classTagModul = ref(defn.ClassTagModule )
40
40
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