Skip to content

Commit 1cf5da9

Browse files
committed
Merge pull request #13 from retronym/topic/sip23-varargs
SIP-23 Account for literal types in varargs translation
2 parents 34cbcbb + 2d64743 commit 1cf5da9

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/compiler/scala/tools/nsc/transform/UnCurry.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ abstract class UnCurry extends InfoTransform
322322
args.take(formals.length - 1) :+ (suffix setType formals.last)
323323
}
324324

325-
val args1 = if (isVarArgTypes(formals)) transformVarargs(formals.last.typeArgs.head) else args
325+
val args1 = if (isVarArgTypes(formals)) transformVarargs(formals.last.typeArgs.head.widen) else args
326326

327327
map2(formals, args1) { (formal, arg) =>
328328
if (!isByNameParamType(formal))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Xexperimental
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object Test extends App {
2+
val x = List.apply[1](1)
3+
assert(x == List(1))
4+
}

0 commit comments

Comments
 (0)