1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
names-defaults-neg.scala:63: error: not enough arguments for method apply: (a: Int,b: String)(c: Int*)Fact in object Fact, unspecified parameter: value b
val fac = Fact(1)(2, 3)
^
names-defaults-neg.scala:5: error: type mismatch;
found : java.lang.String("#")
required: Int
test1(b = 2, a = "#")
^
names-defaults-neg.scala:8: error: positional after named argument.
test1(a = 1, "*")
^
names-defaults-neg.scala:9: error: positional after named argument.
test1(b = "(*", 23)
^
names-defaults-neg.scala:14: error: reference to x is ambiguous; it is both, a parameter
name of the method and the name of a variable currently in scope.
test2(x = 1)
^
names-defaults-neg.scala:16: error: not found: value c
test1(c = 0, b = "joke")
^
names-defaults-neg.scala:20: error: parameter specified twice: a
test1(1, a = 2)
^
names-defaults-neg.scala:21: error: parameter specified twice: b
test1(b = 1, b = "2")
^
names-defaults-neg.scala:24: error: {
val x$1: Int(3) = 3;
val x$2: Int(1) = 1;
Test.this.test3(1, 3)
} of type Int does not take parameters
test3(b = 3, a = 1)(3)
^
names-defaults-neg.scala:33: error: ambiguous reference to overloaded definition,
both method f in object t1 of type (b: String,a: Int)java.lang.String
and method f in object t1 of type (a: Int,b: String)java.lang.String
match argument types (b: java.lang.String,a: Int)
t1.f(b = "dkljf", a = 1)
^
names-defaults-neg.scala:40: error: ambiguous reference to overloaded definition,
both method f in object t3 of type (a2: Int)(b: Int)java.lang.String
and method f in object t3 of type (a1: Int)java.lang.String
match argument types (Int)
t3.f(1)
^
names-defaults-neg.scala:41: error: ambiguous reference to overloaded definition,
both method f in object t3 of type (a2: Int)(b: Int)java.lang.String
and method f in object t3 of type (a1: Int)java.lang.String
match argument types (Int)
t3.f(1)(2)
^
names-defaults-neg.scala:47: error: ambiguous reference to overloaded definition,
both method g in object t7 of type (a: B)java.lang.String
and method g in object t7 of type (a: C,b: Int*)java.lang.String
match argument types (C)
t7.g(new C()) // ambigous reference
^
names-defaults-neg.scala:51: error: parameter specified twice: b
test5(a = 1, b = "dkjl", b = "dkj")
^
names-defaults-neg.scala:52: error: parameter specified twice: b
test5(1, "2", b = 3)
^
names-defaults-neg.scala:53: error: when using named arguments, the vararg parameter has to be specified exactly once
test5(b = "dlkj")
^
names-defaults-neg.scala:59: error: ambiguous reference to overloaded definition,
both method f in object t8 of type (b: String,a: Int)java.lang.String
and method f in object t8 of type (a: Int,b: java.lang.Object)java.lang.String
match argument types (a: Int,b: java.lang.String) and expected result type Any
println(t8.f(a = 0, b = "1")) // ambigous reference
^
names-defaults-neg.scala:75: error: multiple overloaded alternatives of method foo define default arguments
def foo(a: Int = 0) = a
^
names-defaults-neg.scala:85: error: multiple overloaded alternatives of method foo define default arguments
override def foo(a: Int = 1092) = a
^
names-defaults-neg.scala:88: error: type mismatch;
found : Int(129083)
required: java.lang.String
def bar(i: Int = 129083) = i
^
names-defaults-neg.scala:88: error: multiple overloaded alternatives of method bar define default arguments
def bar(i: Int = 129083) = i
^
names-defaults-neg.scala:93: error: using named or default arguments in a super constructor call is not allowed
class B1 extends A1(10)
^
names-defaults-neg.scala:94: error: using named or default arguments in a super constructor call is not allowed
class B2 extends A1(y = 20, x = 2)
^
names-defaults-neg.scala:99: error: using named or default arguments in a self constructor call is not allowed
this(y = 10, x = a.toString())
^
names-defaults-neg.scala:105: error: using named or default arguments in a self constructor call is not allowed
this(sep + b + sep)
^
25 errors found
|