@@ -78,13 +78,13 @@ package foo.test.companionprivate:
78
78
package foo .test .i16678:
79
79
def foo (func : Int => String , value : Int ): String = func(value) // OK
80
80
81
- def run =
81
+ def run =
82
82
println(foo(number => number.toString, value = 5 )) // OK
83
83
println(foo(number => " <number>" , value = 5 )) // error
84
84
println(foo(func = number => " <number>" , value = 5 )) // error
85
85
println(foo(func = number => number.toString, value = 5 )) // OK
86
86
println(foo(func = _.toString, value = 5 )) // OK
87
-
87
+
88
88
package foo .test .possibleclasses:
89
89
case class AllCaseClass (
90
90
k : Int , // OK
@@ -93,7 +93,7 @@ package foo.test.possibleclasses:
93
93
s : Int , // error /* But not these */
94
94
val t : Int , // OK
95
95
private val z : Int // error
96
- )
96
+ )
97
97
98
98
case class AllCaseUsed (
99
99
k : Int , // OK
@@ -113,7 +113,7 @@ package foo.test.possibleclasses:
113
113
s : Int , // error
114
114
val t : Int , // OK
115
115
private val z : Int // error
116
- )
116
+ )
117
117
118
118
class AllUsed (
119
119
k : Int , // OK
@@ -124,10 +124,44 @@ package foo.test.possibleclasses:
124
124
private val z : Int // OK
125
125
) {
126
126
def a = k + y + s + t + z
127
- }
127
+ }
128
128
129
129
package foo .test .from .i16675:
130
130
case class PositiveNumber private (i : Int ) // OK
131
131
object PositiveNumber :
132
- def make (i : Int ): Option [PositiveNumber ] = // OK
132
+ def make (i : Int ): Option [PositiveNumber ] = // OK
133
133
Option .when(i >= 0 )(PositiveNumber (i)) // OK
134
+
135
+ package foo .test .i16822:
136
+ enum ExampleEnum {
137
+ case Build (context : String ) // OK
138
+ case List // OK
139
+ }
140
+
141
+ def demo = {
142
+ val x = ExampleEnum .List // OK
143
+ println(x) // OK
144
+ }
145
+
146
+ package foo .test .i16877:
147
+ import scala .collection .immutable .HashMap // OK
148
+ import scala .annotation .StaticAnnotation // OK
149
+
150
+ class ExampleAnnotation (val a : Object ) extends StaticAnnotation // OK
151
+
152
+ @ ExampleAnnotation (new HashMap ()) // OK
153
+ class Test // OK
154
+
155
+ package foo .test .i16926:
156
+ def hello (): Unit =
157
+ for {
158
+ i <- (0 to 10 ).toList
159
+ (a, b) = " hello" -> " world" // OK
160
+ } yield println(s " $a $b" )
161
+
162
+ package foo .test .i16925:
163
+ def hello =
164
+ for {
165
+ i <- 1 to 2 if true
166
+ _ = println(i) // OK
167
+ } yield ()
0 commit comments