File tree 2 files changed +3
-3
lines changed
compiler/test/dotty/tools/repl
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -170,8 +170,8 @@ class ReplCompilerTests extends ReplTest {
170
170
run("""
171
171
|trait Ord[T] {
172
172
| def compare(x: T, y: T): Int
173
- | def (x: T) < (y: T) = compare(x, y) < 0
174
- | def (x: T) > (y: T) = compare(x, y) > 0
173
+ | extension (x: T) def < (y: T) = compare(x, y) < 0
174
+ | extension (x: T) def > (y: T) = compare(x, y) > 0
175
175
|}
176
176
|
177
177
|given IntOrd as Ord[Int] {
Original file line number Diff line number Diff line change 1
1
object A {
2
- sealed def y : Int = 1 // error : modifier(s) `sealed' not allowed for method
2
+ // sealed def y: Int = 1 // err-or : modifier(s) `sealed' not allowed for method
3
3
sealed var x = 1 // error: modifier(s) `sealed' not allowed for variable
4
4
lazy trait T // error: modifier(s) `lazy' not allowed for trait
5
5
}
You can’t perform that action at this time.
0 commit comments