File tree 2 files changed +12
-1
lines changed
compiler/src/dotty/tools/dotc/core 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -533,6 +533,9 @@ class TypeApplications(val self: Type) extends AnyVal {
533
533
case JavaArrayType (elemtp) => elemtp
534
534
case tp : OrType if tp.tp1.isBottomType => tp.tp2.elemType
535
535
case tp : OrType if tp.tp2.isBottomType => tp.tp1.elemType
536
- case _ => self.baseType(defn.SeqClass ).argInfos.headOption.getOrElse(NoType )
536
+ case _ =>
537
+ self.baseType(defn.SeqClass )
538
+ .orElse(self.baseType(defn.ArrayClass ))
539
+ .argInfos.headOption.getOrElse(NoType )
537
540
}
538
541
}
Original file line number Diff line number Diff line change
1
+ class Test :
2
+ val a : Array [Any ] = Array [Any ]()
3
+ val b : Array [Any ] = Array [Any ]()
4
+
5
+ def ko (p : Boolean ): Unit = foo((if p then a else b): _* )
6
+ def ok (p : Boolean ): Unit = foo({ val x = if p then a else b; x }: _* )
7
+
8
+ def foo (in : Any * ): Unit = ()
You can’t perform that action at this time.
0 commit comments