Skip to content

Commit b91a144

Browse files
authored
Merge pull request scala#8973 from som-snytt/issue/11281
2 parents aa99963 + 9c743cc commit b91a144

14 files changed

+114
-71
lines changed

src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ trait ContextErrors {
605605
def NamedAndDefaultArgumentsNotSupportedForMacros(tree: Tree, fun: Tree) =
606606
NormalTypeError(tree, "macro applications do not support named and/or default arguments")
607607

608-
def TooManyArgsNamesDefaultsError(tree: Tree, fun: Tree, formals: List[Type], args: List[Tree], namelessArgs: List[Tree], argPos: Array[Int]) = {
608+
def TooManyArgsNamesDefaultsError(tree: Tree, fun: Tree, formals: List[Type], args: List[Tree], argPos: Array[Int]) = {
609609
val expected = formals.size
610610
val supplied = args.size
611611
// pick a caret. For f(k=1,i=2,j=3), argPos[0,-1,1] b/c `k=1` taken as arg0
@@ -614,35 +614,20 @@ trait ContextErrors {
614614
if (i < 0) tree else args(i min (supplied - 1))
615615
}
616616
val msg = {
617-
val badappl = {
618-
val excess = supplied - expected
619-
val target = treeSymTypeMsg(fun)
620-
621-
if (expected == 0) args match {
622-
case (c @ Literal(Constant(()))) :: Nil if c.hasAttachment[SyntheticUnitAttachment.type] =>
623-
s"can't supply unit value with infix notation because nullary $target takes no arguments; use dotted invocation instead: ${show(treeCopy.Apply(tree, fun, Nil))}"
624-
case _ => s"no arguments allowed for nullary $target"
625-
}
626-
else if (excess < 3 && expected <= 5) s"too many arguments ($supplied) for $target"
627-
else if (expected > 10) s"$supplied arguments but expected $expected for $target"
628-
else {
629-
val more =
630-
if (excess == 1) "one more argument"
631-
else if (excess > 0) s"$excess more arguments"
632-
else "too many arguments"
633-
s"$more than can be applied to $target"
634-
}
635-
}
636-
val unknowns = (namelessArgs zip args) collect {
637-
case (_: Assign, NamedArg(Ident(name), _)) => name
617+
val target = treeSymTypeMsg(fun)
618+
def isAutoTuplable = AnyRefTpe <:< (if (formals.head.typeSymbol.isTypeParameter) formals.head.upperBound else formals.head)
619+
620+
expected match {
621+
case 0 =>
622+
args match {
623+
case (c @ Literal(Constant(()))) :: Nil if c.hasAttachment[SyntheticUnitAttachment.type] =>
624+
s"can't supply unit value with infix notation because nullary $target takes no arguments; use dotted invocation instead: ${show(treeCopy.Apply(tree, fun, Nil))}"
625+
case _ => s"no arguments allowed for nullary $target"
626+
}
627+
case 1 if isTupleType(formals.head) => s"too many arguments (found $supplied, expected ${formals.head.typeArgs.size}-tuple) for $target"
628+
case 1 if supplied > MaxTupleArity && isAutoTuplable => s"too many arguments (found $supplied, which exceeds the largest Tuple) for $target"
629+
case _ => s"too many arguments (found $supplied, expected $expected) for $target"
638630
}
639-
val suppl =
640-
unknowns.size match {
641-
case 0 => ""
642-
case 1 => s"\nNote that '${unknowns.head}' is not a parameter name of the invoked method."
643-
case _ => unknowns.mkString("\nNote that '", "', '", "' are not parameter names of the invoked method.")
644-
}
645-
s"${badappl}${suppl}"
646631
}
647632
NormalTypeError(excessive, msg)
648633
}

src/compiler/scala/tools/nsc/typechecker/Typers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3688,8 +3688,8 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
36883688
duplErrorTree(WrongNumberOfArgsError(tree, fun))
36893689
} else if (lencmp > 0) {
36903690
tryTupleApply orElse duplErrorTree {
3691-
val (namelessArgs, argPos) = removeNames(Typer.this)(args, params)
3692-
TooManyArgsNamesDefaultsError(tree, fun, formals, args, namelessArgs, argPos)
3691+
val (_, argPos) = removeNames(Typer.this)(args, params)
3692+
TooManyArgsNamesDefaultsError(tree, fun, formals, args, argPos)
36933693
}
36943694
} else if (lencmp == 0) {
36953695
// we don't need defaults. names were used, so this application is transformed

test/files/neg/eta-expand-star.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
eta-expand-star.scala:6: error: too many arguments (2) for method apply: (v1: Seq[T]): Unit in trait Function1
1+
eta-expand-star.scala:6: error: too many arguments (found 2, expected 1) for method apply: (v1: Seq[T]): Unit in trait Function1
22
g(1, 2)
33
^
44
1 error

test/files/neg/macro-invalidusage-badargs.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Macros_Test_2.scala:9: error: not enough arguments for macro method foo: (x: Int
1313
Unspecified value parameter x.
1414
foo()
1515
^
16-
Macros_Test_2.scala:10: error: too many arguments (2) for macro method foo: (x: Int): Int
16+
Macros_Test_2.scala:10: error: too many arguments (found 2, expected 1) for macro method foo: (x: Int): Int
1717
foo(4, 2)
1818
^
1919
5 errors

test/files/neg/multi-array.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
multi-array.scala:9: error: too many arguments (2) for constructor Array: (_length: Int): Array[T]
1+
multi-array.scala:9: error: too many arguments (found 2, expected 1) for constructor Array: (_length: Int): Array[T]
22
val a: Array[Int] = new Array(10, 10)
33
^
44
1 error

test/files/neg/t10207.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
t10207.scala:14: error: too many arguments (2) for method apply: (key: Int): scala.collection.mutable.ArrayBuffer[String] in trait MapOps
1+
t10207.scala:14: error: too many arguments (found 2, expected 1) for method apply: (key: Int): scala.collection.mutable.ArrayBuffer[String] in trait MapOps
22
m(1, (_ => empty)) ++= AB("eins", "uno")
33
^
44
1 error

test/files/neg/t1112.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
t1112.scala:12: error: too many arguments (2) for method call: (p: Int)(f: => Test.this.Type1): Unit
1+
t1112.scala:12: error: too many arguments (found 2, expected 1) for method call: (p: Int)(f: => Test.this.Type1): Unit
22
call(0,() => System.out.println("here we are"))
33
^
44
1 error

test/files/neg/t1523.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
t1523.scala:4: error: 25 more arguments than can be applied to method bug: (x: Any): Any
1+
t1523.scala:4: error: too many arguments (found 26, which exceeds the largest Tuple) for method bug: (x: Any): Any
22
def go() = bug("a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a")
33
^
44
1 error

test/files/neg/t6920.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
t6920.scala:9: error: too many arguments (2) for method applyDynamicNamed: (values: Seq[(String, Any)]): String
1+
t6920.scala:9: error: too many arguments (found 2, expected 1) for method applyDynamicNamed: (values: Seq[(String, Any)]): String
22
error after rewriting to CompilerError.this.test.applyDynamicNamed("crushTheCompiler")(scala.Tuple2("a", 1), scala.Tuple2("b", 2))
33
possible cause: maybe a wrong Dynamic method signature?
44
test.crushTheCompiler(a = 1, b = 2)

test/files/neg/t7157.check

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Test_2.scala:9: error: not enough arguments for macro method m1_1_1: (x: Int): U
1111
Unspecified value parameter x.
1212
m1_1_1()
1313
^
14-
Test_2.scala:11: error: too many arguments (2) for macro method m1_1_1: (x: Int): Unit
14+
Test_2.scala:11: error: too many arguments (found 2, expected 1) for macro method m1_1_1: (x: Int): Unit
1515
m1_1_1(1, 2)
1616
^
17-
Test_2.scala:12: error: too many arguments (3) for macro method m1_1_1: (x: Int): Unit
17+
Test_2.scala:12: error: too many arguments (found 3, expected 1) for macro method m1_1_1: (x: Int): Unit
1818
m1_1_1(1, 2, 3)
1919
^
2020
Test_2.scala:14: error: not enough arguments for macro method m1_2_2: (x: Int, y: Int): Unit.
@@ -25,7 +25,7 @@ Test_2.scala:15: error: not enough arguments for macro method m1_2_2: (x: Int, y
2525
Unspecified value parameter y.
2626
m1_2_2(1)
2727
^
28-
Test_2.scala:17: error: too many arguments (3) for macro method m1_2_2: (x: Int, y: Int): Unit
28+
Test_2.scala:17: error: too many arguments (found 3, expected 2) for macro method m1_2_2: (x: Int, y: Int): Unit
2929
m1_2_2(1, 2, 3)
3030
^
3131
Test_2.scala:24: error: not enough arguments for macro method m1_1_inf: (x: Int, y: Int*): Unit.
@@ -53,10 +53,10 @@ Test_2.scala:39: error: not enough arguments for macro method m2_1_1: (x: Int):
5353
Unspecified value parameter x.
5454
m2_1_1()()
5555
^
56-
Test_2.scala:41: error: too many arguments (2) for macro method m2_1_1: (x: Int): Unit
56+
Test_2.scala:41: error: too many arguments (found 2, expected 1) for macro method m2_1_1: (x: Int): Unit
5757
m2_1_1()(1, 2)
5858
^
59-
Test_2.scala:42: error: too many arguments (3) for macro method m2_1_1: (x: Int): Unit
59+
Test_2.scala:42: error: too many arguments (found 3, expected 1) for macro method m2_1_1: (x: Int): Unit
6060
m2_1_1()(1, 2, 3)
6161
^
6262
Test_2.scala:44: error: not enough arguments for macro method m2_2_2: (x: Int, y: Int): Unit.
@@ -67,7 +67,7 @@ Test_2.scala:45: error: not enough arguments for macro method m2_2_2: (x: Int, y
6767
Unspecified value parameter y.
6868
m2_2_2()(1)
6969
^
70-
Test_2.scala:47: error: too many arguments (3) for macro method m2_2_2: (x: Int, y: Int): Unit
70+
Test_2.scala:47: error: too many arguments (found 3, expected 2) for macro method m2_2_2: (x: Int, y: Int): Unit
7171
m2_2_2()(1, 2, 3)
7272
^
7373
Test_2.scala:54: error: not enough arguments for macro method m2_1_inf: (x: Int, y: Int*): Unit.

test/files/neg/t8006.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
t8006.scala:3: error: too many arguments (2) for method applyDynamicNamed: (value: (String, Any)): String
1+
t8006.scala:3: error: too many arguments (found 2, expected 2-tuple) for method applyDynamicNamed: (value: (String, Any)): String
22
error after rewriting to X.this.d.applyDynamicNamed("meth")(scala.Tuple2("value1", 10), scala.Tuple2("value2", 100))
33
possible cause: maybe a wrong Dynamic method signature?
44
d.meth(value1 = 10, value2 = 100) // two arguments here, but only one is allowed

test/files/neg/t8667.check

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
t8667.scala:6: error: unknown parameter name: c
22
def c2 = new C(a = 42, b = 17, c = 5)
33
^
4-
t8667.scala:6: error: too many arguments (3) for constructor C: (a: Int, b: Int): C
4+
t8667.scala:6: error: too many arguments (found 3, expected 2) for constructor C: (a: Int, b: Int): C
55
def c2 = new C(a = 42, b = 17, c = 5)
66
^
77
t8667.scala:7: error: unknown parameter name: c
88
def c3 = new C(b = 42, a = 17, c = 5)
99
^
10-
t8667.scala:7: error: too many arguments (3) for constructor C: (a: Int, b: Int): C
10+
t8667.scala:7: error: too many arguments (found 3, expected 2) for constructor C: (a: Int, b: Int): C
1111
def c3 = new C(b = 42, a = 17, c = 5)
1212
^
1313
t8667.scala:8: error: positional after named argument.
1414
def c4 = new C(b = 42, a = 17, 5)
1515
^
16-
t8667.scala:8: error: too many arguments (3) for constructor C: (a: Int, b: Int): C
16+
t8667.scala:8: error: too many arguments (found 3, expected 2) for constructor C: (a: Int, b: Int): C
1717
def c4 = new C(b = 42, a = 17, 5)
1818
^
1919
t8667.scala:9: error: unknown parameter name: c
@@ -22,19 +22,19 @@ t8667.scala:9: error: unknown parameter name: c
2222
t8667.scala:10: error: unknown parameter name: c
2323
def c6 = new C(a = 42, c = 17, b = 5)
2424
^
25-
t8667.scala:10: error: too many arguments (3) for constructor C: (a: Int, b: Int): C
25+
t8667.scala:10: error: too many arguments (found 3, expected 2) for constructor C: (a: Int, b: Int): C
2626
def c6 = new C(a = 42, c = 17, b = 5)
2727
^
2828
t8667.scala:11: error: unknown parameter name: c
2929
def c7 = new C(c = 42, a = 17, b = 5)
3030
^
31-
t8667.scala:11: error: too many arguments (3) for constructor C: (a: Int, b: Int): C
31+
t8667.scala:11: error: too many arguments (found 3, expected 2) for constructor C: (a: Int, b: Int): C
3232
def c7 = new C(c = 42, a = 17, b = 5)
3333
^
3434
t8667.scala:12: error: parameter 'b' is already specified at parameter position 2
3535
def c8 = new C(42, 17, b = 5)
3636
^
37-
t8667.scala:12: error: too many arguments (3) for constructor C: (a: Int, b: Int): C
37+
t8667.scala:12: error: too many arguments (found 3, expected 2) for constructor C: (a: Int, b: Int): C
3838
def c8 = new C(42, 17, b = 5)
3939
^
4040
t8667.scala:13: error: unknown parameter name: c
@@ -43,7 +43,7 @@ t8667.scala:13: error: unknown parameter name: c
4343
t8667.scala:13: error: unknown parameter name: d
4444
def c9 = new C(a = 42, c = 17, d = 3, b = 5)
4545
^
46-
t8667.scala:13: error: too many arguments (4) for constructor C: (a: Int, b: Int): C
46+
t8667.scala:13: error: too many arguments (found 4, expected 2) for constructor C: (a: Int, b: Int): C
4747
def c9 = new C(a = 42, c = 17, d = 3, b = 5)
4848
^
4949
t8667.scala:14: error: unknown parameter name: d
@@ -52,55 +52,79 @@ t8667.scala:14: error: unknown parameter name: d
5252
t8667.scala:14: error: unknown parameter name: c
5353
def c0 = new C(42, 17, d = 3, c = 5)
5454
^
55-
t8667.scala:14: error: too many arguments (4) for constructor C: (a: Int, b: Int): C
55+
t8667.scala:14: error: too many arguments (found 4, expected 2) for constructor C: (a: Int, b: Int): C
5656
def c0 = new C(42, 17, d = 3, c = 5)
5757
^
58-
t8667.scala:25: error: no arguments allowed for nullary method f0: (): Int
58+
t8667.scala:31: error: no arguments allowed for nullary method f0: (): Int
5959
f0(1)
6060
^
61-
t8667.scala:26: error: too many arguments (2) for method f1: (i: Int): Int
61+
t8667.scala:32: error: too many arguments (found 2, expected 1) for method f1: (i: Int): Int
6262
f1(1, 2)
6363
^
64-
t8667.scala:27: error: too many arguments (3) for method f1: (i: Int): Int
64+
t8667.scala:33: error: too many arguments (found 3, expected 1) for method f1: (i: Int): Int
6565
f1(1, 2, 3)
6666
^
67-
t8667.scala:28: error: 3 more arguments than can be applied to method f1: (i: Int): Int
67+
t8667.scala:34: error: too many arguments (found 4, expected 1) for method f1: (i: Int): Int
6868
f1(1, 2, 3, 4)
6969
^
70-
t8667.scala:29: error: unknown parameter name: j
70+
t8667.scala:35: error: unknown parameter name: j
7171
f1(1, j = 2, 3, 4)
7272
^
73-
t8667.scala:29: error: 3 more arguments than can be applied to method f1: (i: Int): Int
73+
t8667.scala:35: error: too many arguments (found 4, expected 1) for method f1: (i: Int): Int
7474
f1(1, j = 2, 3, 4)
7575
^
76-
t8667.scala:30: error: unknown parameter name: j
76+
t8667.scala:36: error: unknown parameter name: j
7777
f1(1, j = 2, k = 3, 4)
7878
^
79-
t8667.scala:30: error: unknown parameter name: k
79+
t8667.scala:36: error: unknown parameter name: k
8080
f1(1, j = 2, k = 3, 4)
8181
^
82-
t8667.scala:30: error: 3 more arguments than can be applied to method f1: (i: Int): Int
82+
t8667.scala:36: error: too many arguments (found 4, expected 1) for method f1: (i: Int): Int
8383
f1(1, j = 2, k = 3, 4)
8484
^
85-
t8667.scala:31: error: unknown parameter name: k
85+
t8667.scala:37: error: unknown parameter name: k
8686
f2(k = 1, i = 2, j = 3)
8787
^
88-
t8667.scala:31: error: too many arguments (3) for method f2: (i: Int, j: Int): Int
88+
t8667.scala:37: error: too many arguments (found 3, expected 2) for method f2: (i: Int, j: Int): Int
8989
f2(k = 1, i = 2, j = 3)
9090
^
91-
t8667.scala:32: error: one more argument than can be applied to method f6: (i: Int, j: Int, k: Int, l: Int, m: Int, n: Int): Int
91+
t8667.scala:38: error: too many arguments (found 7, expected 6) for method f6: (i: Int, j: Int, k: Int, l: Int, m: Int, n: Int): Int
9292
f6(1, 2, 3, 4, 5, 6, 7)
9393
^
94-
t8667.scala:33: error: 2 more arguments than can be applied to method f6: (i: Int, j: Int, k: Int, l: Int, m: Int, n: Int): Int
94+
t8667.scala:39: error: too many arguments (found 8, expected 6) for method f6: (i: Int, j: Int, k: Int, l: Int, m: Int, n: Int): Int
9595
f6(1, 2, 3, 4, 5, 6, 7, 8)
9696
^
97-
t8667.scala:34: error: 15 arguments but expected 12 for method f12: (i: Int, j: Int, k: Int, l: Int, m: Int, n: Int, o: Int, p: Int, q: Int, r: Int, s: Int, t: Int): Int
97+
t8667.scala:40: error: too many arguments (found 15, expected 12) for method f12: (i: Int, j: Int, k: Int, l: Int, m: Int, n: Int, o: Int, p: Int, q: Int, r: Int, s: Int, t: Int): Int
9898
f12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
9999
^
100-
t8667.scala:42: error: can't supply unit value with infix notation because nullary method f0: (): Int takes no arguments; use dotted invocation instead: x.f0()
100+
t8667.scala:46: error: too many arguments (found 22, expected 1) for method mini: (x: A): Int
101+
mini(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
102+
^
103+
t8667.scala:48: error: too many arguments (found 24, which exceeds the largest Tuple) for method max: (x: Any): Int
104+
max(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
105+
^
106+
t8667.scala:49: error: too many arguments (found 24, which exceeds the largest Tuple) for method maxi: (x: A): Int
107+
maxi(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
108+
^
109+
t8667.scala:50: error: too many arguments (found 24, which exceeds the largest Tuple) for method moxi: (x: AnyRef): Int
110+
moxi(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
111+
^
112+
t8667.scala:51: error: too many arguments (found 24, which exceeds the largest Tuple) for method movi: (x: Object): Int
113+
movi(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
114+
^
115+
t8667.scala:52: error: too many arguments (found 24, expected 1) for method mini: (x: A): Int
116+
mini(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
117+
^
118+
t8667.scala:64: error: too many arguments (found 3, expected 2-tuple) for method t: (t: (Int, Int)): Nothing
119+
def z = t(42, 27, 17)
120+
^
121+
t8667.scala:70: error: unknown parameter name: c
122+
def x = f(c = "hello, world")
123+
^
124+
t8667.scala:76: error: can't supply unit value with infix notation because nullary method f0: (): Int takes no arguments; use dotted invocation instead: x.f0()
101125
x f0 ()
102126
^
103-
t8667.scala:43: error: no arguments allowed for nullary method f0: (): Int
127+
t8667.scala:77: error: no arguments allowed for nullary method f0: (): Int
104128
x.f0(())
105129
^
106-
35 errors
130+
43 errors

test/files/neg/t8667.scala

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ trait T {
1515
}
1616

1717
trait X {
18+
trait Upper
1819
def f0() = 42
1920
def f1(i: Int) = 42
2021
def f2(i: Int, j: Int) = 42
2122
def f6(i: Int, j: Int, k: Int, l: Int, m: Int, n: Int) = 42
2223
def f12(i: Int, j: Int, k: Int, l: Int, m: Int, n: Int, o: Int, p: Int, q: Int, r: Int, s: Int, t: Int) = 42
24+
def max(x: Any) = 42
25+
def maxi[A](x: A) = 42
26+
def mini[A <: Upper](x: A) = 42
27+
def moxi(x: AnyRef) = 42
28+
def movi(x: Object) = 42
2329

2430
def g() = {
2531
f0(1)
@@ -32,10 +38,38 @@ trait X {
3238
f6(1, 2, 3, 4, 5, 6, 7)
3339
f6(1, 2, 3, 4, 5, 6, 7, 8)
3440
f12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
41+
// confirm auto-tupling
42+
max(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
43+
maxi(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
44+
moxi(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
45+
movi(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
46+
mini(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
47+
// clarify auto-tupling failure
48+
max(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
49+
maxi(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
50+
moxi(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
51+
movi(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
52+
mini(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
3553
()
3654
}
3755
}
3856

57+
trait Y {
58+
def f[A](a: A) = ???
59+
def g(x: Any) = ???
60+
def t(t: (Int, Int)) = ???
61+
62+
def x = f(42, 27, 17)
63+
def y = g(42, 27, 17)
64+
def z = t(42, 27, 17)
65+
}
66+
67+
trait Z {
68+
def f(a: Int = 1, b: String = "") = b * a
69+
70+
def x = f(c = "hello, world")
71+
}
72+
3973
object app {
4074
def test(): Unit = {
4175
val x = null.asInstanceOf[X]

0 commit comments

Comments
 (0)