summaryrefslogtreecommitdiff
path: root/test/files/neg/names-defaults-neg.check
blob: a43bf6681161cc4c42d651814e839143da1de998 (plain) (blame)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
names-defaults-neg.scala:65: error: not enough arguments for method apply: (a: Int, b: String)(c: Int*)Fact in object Fact.
Unspecified value parameter b.
  val fac = Fact(1)(2, 3)
                ^
names-defaults-neg.scala:5: error: type mismatch;
 found   : String("#")
 required: Int
  test1(b = 2, a = "#")
                   ^
names-defaults-neg.scala:5: error: type mismatch;
 found   : Int(2)
 required: String
  test1(b = 2, a = "#")
            ^
names-defaults-neg.scala:8: error: positional after named argument.
  test1(b = "(*", 23)
                  ^
names-defaults-neg.scala:13: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
  test2(x = 1)
          ^
names-defaults-neg.scala:15: error: not found: value c
  test1(c = 0, b = "joke")
        ^
names-defaults-neg.scala:16: error: not found: value m
  test7((m = 1))  // named arguments must be top-level assignments
         ^
names-defaults-neg.scala:17: error: not found: value m
  test7({m = 1})
         ^
names-defaults-neg.scala:18: error: not found: value m
  test7 { m = 1 } // no named arguments in argument block
          ^
names-defaults-neg.scala:19: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
  test8(x = 1)
          ^
names-defaults-neg.scala:22: error: parameter 'a' is already specified at parameter position 1
  test1(1, a = 2)
             ^
names-defaults-neg.scala:23: error: parameter 'b' is already specified at parameter position 1
  test1(b = 1, b = "2")
                 ^
names-defaults-neg.scala:26: error: Int does not take parameters
  test3(b = 3, a = 1)(3)
                     ^
names-defaults-neg.scala:35: error: ambiguous reference to overloaded definition,
both method f in object t1 of type (b: String, a: Int)String
and  method f in object t1 of type (a: Int, b: String)String
match argument types (b: String,a: Int)
  t1.f(b = "dkljf", a = 1)
     ^
names-defaults-neg.scala:42: error: ambiguous reference to overloaded definition,
both method f in object t3 of type (a2: Int)(b: Int)String
and  method f in object t3 of type (a1: Int)String
match argument types (Int)
  t3.f(1)
     ^
names-defaults-neg.scala:43: error: ambiguous reference to overloaded definition,
both method f in object t3 of type (a2: Int)(b: Int)String
and  method f in object t3 of type (a1: Int)String
match argument types (Int)
  t3.f(1)(2)
     ^
names-defaults-neg.scala:49: error: ambiguous reference to overloaded definition,
both method g in object t7 of type (a: B)String
and  method g in object t7 of type (a: C, b: Int*)String
match argument types (C)
  t7.g(new C()) // ambiguous reference
     ^
names-defaults-neg.scala:53: error: parameter 'b' is already specified at parameter position 2
  test5(a = 1, b = "dkjl", b = "dkj")
                             ^
names-defaults-neg.scala:54: error: parameter 'b' is already specified at parameter position 2
  test5(1, "2", b = 3)
                  ^
names-defaults-neg.scala:55: error: when using named arguments, the vararg parameter has to be specified exactly once
  test5(b = "dlkj")
       ^
names-defaults-neg.scala:61: error: ambiguous reference to overloaded definition,
both method f in object t8 of type (b: String, a: Int)String
and  method f in object t8 of type (a: Int, b: Object)String
match argument types (a: Int,b: String) and expected result type Any
  println(t8.f(a = 0, b = "1")) // ambiguous reference
             ^
names-defaults-neg.scala:69: error: wrong number of arguments for pattern A1(x: Int,y: String)
  A1() match { case A1(_) => () }
                      ^
names-defaults-neg.scala:76: error: no type parameters for method test4: (x: T[T[List[T[X forSome { type X }]]]])T[T[List[T[X forSome { type X }]]]] exist so that it can be applied to arguments (List[Int])
 --- because ---
argument expression's type is not compatible with formal parameter type;
 found   : List[Int]
 required: ?T[?T[List[?T[X forSome { type X }]]]]
Error occurred in an application involving default arguments.
  test4()
  ^
names-defaults-neg.scala:79: error: type mismatch;
 found   : List[Int]
 required: List[List[?]]
  def test6[T](x: List[List[T]] = List(1,2)) = x
                                      ^
names-defaults-neg.scala:82: error: type mismatch;
 found   : Int
 required: String
Error occurred in an application involving default arguments.
  new A2[String]()
  ^
names-defaults-neg.scala:86: error: module extending its companion class cannot use default constructor arguments
    object C extends C()
                     ^
names-defaults-neg.scala:90: error: deprecated parameter name x has to be distinct from any other parameter name (deprecated or not).
  def deprNam1(x: Int, @deprecatedName('x) y: String) = 0
                                           ^
names-defaults-neg.scala:91: error: deprecated parameter name a has to be distinct from any other parameter name (deprecated or not).
  def deprNam2(a: String)(@deprecatedName('a) b: Int) = 1
                                              ^
names-defaults-neg.scala:93: warning: the parameter name y has been deprecated. Use b instead.
  deprNam3(y = 10, b = 2)
             ^
names-defaults-neg.scala:93: error: parameter 'b' is already specified at parameter position 1
  deprNam3(y = 10, b = 2)
                     ^
names-defaults-neg.scala:98: error: unknown parameter name: m
  f3818(y = 1, m = 1)
                 ^
names-defaults-neg.scala:131: error: reference to var2 is ambiguous; it is both a method parameter and a variable in scope.
  delay(var2 = 40)
             ^
names-defaults-neg.scala:134: error: missing parameter type for expanded function ((x$1) => a = x$1)
  val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
                                         ^
names-defaults-neg.scala:134: error: not found: value a
  val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
                                     ^
names-defaults-neg.scala:134: error: not found: value get
  val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
                                                ^
names-defaults-neg.scala:135: error: parameter 'a' is already specified at parameter position 1
  val taf3 = testAnnFun(b = _: String, a = get(8))
                                         ^
names-defaults-neg.scala:136: error: missing parameter type for expanded function ((x$3) => testAnnFun(x$3, ((x$4) => b = x$4)))
  val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
                                               ^
names-defaults-neg.scala:136: error: missing parameter type for expanded function ((x$4) => b = x$4)
  val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
                                                      ^
names-defaults-neg.scala:136: error: not found: value b
  val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
                                                  ^
names-defaults-neg.scala:144: error: variable definition needs type because 'x' is used as a named argument in its body.
  def t3 { var x = t.f(x = 1) }
               ^
names-defaults-neg.scala:147: error: variable definition needs type because 'x' is used as a named argument in its body.
  object t6 { var x = t.f(x = 1) }
                  ^
names-defaults-neg.scala:147: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
an explicit type is required for the definition mentioned in the error message above.
  object t6 { var x = t.f(x = 1) }
                            ^
names-defaults-neg.scala:150: error: variable definition needs type because 'x' is used as a named argument in its body.
  class t9 { var x = t.f(x = 1) }
                 ^
names-defaults-neg.scala:150: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
an explicit type is required for the definition mentioned in the error message above.
  class t9 { var x = t.f(x = 1) }
                           ^
names-defaults-neg.scala:164: error: variable definition needs type because 'x' is used as a named argument in its body.
  def u3 { var x = u.f(x = 1) }
               ^
names-defaults-neg.scala:167: error: variable definition needs type because 'x' is used as a named argument in its body.
  def u6 { var x = u.f(x = "32") }
               ^
names-defaults-neg.scala:170: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
  def u9 { var x: Int = u.f(x = 1) }
                              ^
names-defaults-neg.scala:177: error: variable definition needs type because 'x' is used as a named argument in its body.
  class u15 { var x = u.f(x = 1) }
                  ^
names-defaults-neg.scala:177: warning: failed to determine if 'x = ...' is a named argument or an assignment expression.
an explicit type is required for the definition mentioned in the error message above.
  class u15 { var x = u.f(x = 1) }
                            ^
names-defaults-neg.scala:180: error: reference to x is ambiguous; it is both a method parameter and a variable in scope.
  class u18 { var x: Int = u.f(x = 1) }
                                 ^
four warnings found
46 errors found