Skip to content

Commit 1ab6027

Browse files
authored
Merge pull request #3718 from dotty-staging/fix-#3630
Fix #3630: Handle classtag searches with wildcard arguments
2 parents b862758 + c1643b1 commit 1ab6027

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/core/TypeErasure.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ object TypeErasure {
320320
case _ => false
321321
}
322322
case tp: TypeParamRef => false
323+
case tp: TypeBounds => false
323324
case tp: TypeProxy => hasStableErasure(tp.superType)
324325
case tp: AndOrType => hasStableErasure(tp.tp1) && hasStableErasure(tp.tp2)
325326
case _ => false

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ trait Implicits { self: Typer =>
564564
* synthesize a class tag for `T`.
565565
*/
566566
def synthesizedClassTag(formal: Type)(implicit ctx: Context): Tree =
567-
formal.argTypes match {
567+
formal.argInfos match {
568568
case arg :: Nil =>
569569
fullyDefinedType(arg, "ClassTag argument", pos) match {
570570
case defn.ArrayOf(elemTp) =>

tests/neg/i3630.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class U { Array(Array(2), Array("a")) } // error: no classtag

0 commit comments

Comments
 (0)