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
When calling a method using named arguments, if the method has an argument with a default value which is not specified, but another (nonexistent) parameter is specified, the compiler gives the error "parameter specified twice" instead of "not found". This is confusing and misleading:
scala>defx(a:Int,b:Int,c:Int,d:Int=0) = println(a,b,c,d)
x: (a: Int, b: Int, c: Int, d: Int)Unit
scala> x(a=1,b=2,c=3)
(1,2,3,0)
scala> x(z=0,a=1,b=2,c=3)
<console>:9:error: parameter specified twice: a
x(z=0,a=1,b=2,c=3)
^
scala> x(z=1,b=2,c=3,d=4)
<console>:9:error: not found: value z
x(z=1,b=2,c=3,d=4)
^
The text was updated successfully, but these errors were encountered:
When calling a method using named arguments, if the method has an argument with a default value which is not specified, but another (nonexistent) parameter is specified, the compiler gives the error "parameter specified twice" instead of "not found". This is confusing and misleading:
The text was updated successfully, but these errors were encountered: