Fix incorrect IncompatibleClassChangeError in ClassInfo.getDefaultMethod (#7)
[jpf-core.git] / src / tests / gov / nasa / jpf / test / vm / basic / MethodTest.java
index 76e114ebeac0182924a70a26da70d5254eb902f3..24a05aeca90d20cb0b1dec54d610cb6052e8e891 100644 (file)
@@ -255,4 +255,24 @@ public class MethodTest extends TestMethodBase {
       assert a.foo() == 1 : "wrong A.foo() called for A1";
     }
   }
+
+
+  interface InterfaceWithDefaultMethod {
+    default int foo() {
+      return 42;
+    }
+  }
+
+  static class Base implements InterfaceWithDefaultMethod {
+  }
+
+  static class Child extends Base implements InterfaceWithDefaultMethod {
+  }
+
+  @Test
+  public void testDefaultMethodCall() {
+    if (verifyNoPropertyViolation()) {
+      assertEquals(42, new Child().foo());
+    }
+  }
 }