You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 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 {
614
614
if (i <0) tree else args(i min (supplied -1))
615
615
}
616
616
valmsg= {
617
-
valbadappl= {
618
-
valexcess= supplied - expected
619
-
valtarget= treeSymTypeMsg(fun)
620
-
621
-
if (expected ==0) args match {
622
-
case (c @Literal(Constant(()))) ::Nilif 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
-
elseif (excess <3&& expected <=5) s"too many arguments ($supplied) for $target"
627
-
elseif (expected >10) s"$supplied arguments but expected $expected for $target"
628
-
else {
629
-
valmore=
630
-
if (excess ==1) "one more argument"
631
-
elseif (excess >0) s"$excess more arguments"
632
-
else"too many arguments"
633
-
s"$more than can be applied to $target"
634
-
}
635
-
}
636
-
valunknowns= (namelessArgs zip args) collect {
637
-
case (_: Assign, NamedArg(Ident(name), _)) => name
case (c @Literal(Constant(()))) ::Nilif 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
+
case1if isTupleType(formals.head) =>s"too many arguments (found $supplied, expected ${formals.head.typeArgs.size}-tuple) for $target"
628
+
case1if 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"
638
630
}
639
-
valsuppl=
640
-
unknowns.size match {
641
-
case0=>""
642
-
case1=>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.")
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
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
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()
101
125
x f0 ()
102
126
^
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
0 commit comments