Skip to content

Commit 727be50

Browse files
committed
adjust tests on JDK 17+ for PermittedSubclasses change
references scala#10105
1 parent d193135 commit 727be50

File tree

8 files changed

+44
-2
lines changed

8 files changed

+44
-2
lines changed

test/files/neg/t8700b-new.check

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Bar_2.scala:4: warning: match may not be exhaustive.
2+
It would fail on the following input: B
3+
def bar1(foo: Foo_1) = foo match {
4+
^
5+
Bar_2.scala:8: warning: match may not be exhaustive.
6+
It would fail on the following inputs: (_ : Baz_1$1), (_ : Baz_1$2), B
7+
def bar2(foo: Baz_1) = foo match {
8+
^
9+
error: No warnings can be incurred under -Werror.
10+
2 warnings
11+
1 error

test/files/neg/t8700b-new/Bar_2.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// javaVersion: 17+
2+
// scalac: -Werror
3+
object Bar {
4+
def bar1(foo: Foo_1) = foo match {
5+
case Foo_1.A => 1
6+
}
7+
8+
def bar2(foo: Baz_1) = foo match {
9+
case Baz_1.A => 1
10+
}
11+
}

test/files/neg/t8700b-new/Baz_1.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// javaVersion: 17+
2+
public enum Baz_1 {
3+
A {
4+
public void baz1() {}
5+
},
6+
B {
7+
public void baz1() {}
8+
};
9+
10+
public abstract void baz1();
11+
public void baz2() {}
12+
}

test/files/neg/t8700b-new/Foo_1.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// javaVersion: 17+
2+
public enum Foo_1 {
3+
A,
4+
B
5+
}

test/files/neg/t8700b.check renamed to test/files/neg/t8700b-old.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Bar_2.scala:3: warning: match may not be exhaustive.
1+
Bar_2.scala:4: warning: match may not be exhaustive.
22
It would fail on the following input: B
33
def bar1(foo: Foo_1) = foo match {
44
^
5-
Bar_2.scala:7: warning: match may not be exhaustive.
5+
Bar_2.scala:8: warning: match may not be exhaustive.
66
It would fail on the following input: B
77
def bar2(foo: Baz_1) = foo match {
88
^

test/files/neg/t8700b/Bar_2.scala renamed to test/files/neg/t8700b-old/Bar_2.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// javaVersion: 8
12
// scalac: -Werror
23
object Bar {
34
def bar1(foo: Foo_1) = foo match {

test/files/neg/t8700b/Baz_1.java renamed to test/files/neg/t8700b-old/Baz_1.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// javaVersion: 8
12
public enum Baz_1 {
23
A {
34
public void baz1() {}

test/files/neg/t8700b/Foo_1.java renamed to test/files/neg/t8700b-old/Foo_1.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// javaVersion: 8
12
public enum Foo_1 {
23
A,
34
B

0 commit comments

Comments
 (0)