Skip to content

Commit 2574a25

Browse files
author
thk123
committed
Add test for inherited method on functional interface
1 parent 31c0c5d commit 2574a25

File tree

7 files changed

+14
-4
lines changed

7 files changed

+14
-4
lines changed
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
interface ChildInterface extends ParentInterface {
2+
3+
}
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
interface ParentInterface {
2+
public int f(int x);
3+
}
Binary file not shown.

jbmc/regression/jbmc/lambda-unhandled-types/Test.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ public static void main() {
66
StubSuperinterface stubSuperinterface = (x -> x);
77
InterfaceDeclaringEquals interfaceDeclaringEquals = (x -> x);
88
InterfaceWithDefaults interfaceWithDefaults = (x -> x);
9+
ChildInterface inheritedInterface = x -> x;
910
}
1011
}

jbmc/regression/jbmc/lambda-unhandled-types/test.desc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ Test.class
77
^ignoring invokedynamic at java::Test.main:\(\)V address 0 which produces a stub type java::StubInterface
88
^ignoring invokedynamic at java::Test.main:\(\)V address 6 which produces type java::StubSuperinterface which should have exactly one abstract method but actually has 0.
99
^ignoring invokedynamic at java::Test.main:\(\)V address 12 which produces type java::InterfaceDeclaringEquals which should have exactly one abstract method but actually has 2.
10-
^ignoring invokedynamic at java::Test.main:\(\)V address 18 which produces type java::InterfaceWithDefaults which should have exactly one abstract method but actually has 2.
10+
^ignoring invokedynamic at java::Test.main:\(\)V address 18 which produces type java::InterfaceWithDefaults
11+
which should have exactly one abstract method but actually has 2.
12+
^ignoring invokedynamic at java::Test.main:\(\)V address \d+ which produces type java::ChildInterface which should have exactly one abstract method but actually has 0.
1113
--
1214
--
13-
This exercises four cases that aren't currently supported: stub interfaces, stub
15+
This exercises five cases that aren't currently supported: stub interfaces, stub
1416
superinterfaces, interfaces that declare methods also declared on
15-
java.lang.Object, and interfaces that provide default methods. All we require at
16-
this point is that jbmc shouldn't crash when these are seen.
17+
java.lang.Object, interfaces that provide default methods, interfaces that
18+
inherit their one method. All we require at this point is that jbmc shouldn't
19+
crash when these are seen.

0 commit comments

Comments
 (0)