File tree Expand file tree Collapse file tree 1 file changed +28
-28
lines changed
compiler/test/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +28
-28
lines changed Original file line number Diff line number Diff line change @@ -8,38 +8,38 @@ import org.junit.Assert.fail
8
8
9
9
class SIP67Tests extends DottyTest :
10
10
11
- @ Test
12
- def sip67test1 : Unit =
13
- val source = """
14
- import scala.language.strictEquality
15
- import scala.language.experimental.strictEqualityPatternMatching
16
- enum Foo:
17
- case Bar
18
-
19
- val _ =
20
- (??? : Foo) match
21
- case Foo.Bar =>
22
- """
23
- val ctx = checkCompile(" typer" , source)((_, ctx) => ())
24
-
11
+ private def checkNoErrors (source : String ): Unit =
12
+ val ctx = checkCompile(" typer" , source)((_, _) => ())
25
13
if ctx.reporter.hasErrors then
26
14
fail(" Unexpected compilation errors were reported" )
27
-
15
+
16
+ @ Test
17
+ def sip67test1 : Unit =
18
+ checkNoErrors :
19
+ """
20
+ import scala.language.strictEquality
21
+ import scala.language.experimental.strictEqualityPatternMatching
22
+ enum Foo:
23
+ case Bar
24
+
25
+ val _ =
26
+ (??? : Foo) match
27
+ case Foo.Bar =>
28
+ """
28
29
@ Test
29
30
def sip67test2 : Unit =
30
- val source = """
31
- import scala.language.strictEquality
32
- import scala.language.experimental.strictEqualityPatternMatching
31
+ checkNoErrors :
32
+ """
33
+ import scala.language.strictEquality
34
+ import scala.language.experimental.strictEqualityPatternMatching
33
35
34
- sealed trait Foo
36
+ sealed trait Foo
35
37
36
- object Foo:
37
- case object Bar extends Foo
38
+ object Foo:
39
+ case object Bar extends Foo
38
40
39
- val _ =
40
- (??? : Foo) match
41
- case Foo.Bar =>
42
- """
43
- val ctx = checkCompile(" typer" , source)((_, ctx) => ())
44
- if ctx.reporter.hasErrors then
45
- fail(" Unexpected compilation errors were reported" )
41
+ val _ =
42
+ (??? : Foo) match
43
+ case Foo.Bar =>
44
+ """
45
+
You can’t perform that action at this time.
0 commit comments