Skip to content

Commit f2e1367

Browse files
committed
[Binding tests] Add test for mixing static and regular interface methods.
1 parent 7bf2216 commit f2e1367

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

external/Java.Interop

tests/CodeGen-Binding/Xamarin.Android.JcwGen-Tests/DimBindingTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ public void TestChainedDefaultInterfaceMethods ()
8383
Assert.AreEqual (6, iface.InvokeFoo ());
8484
}
8585

86+
[Test]
87+
public void TestStaticInterfaceMethods ()
88+
{
89+
Assert.AreEqual (0, IDefaultMethodsInterface.StaticFoo ());
90+
}
91+
8692
class ManagedEmptyDefault : Java.Lang.Object, IDefaultMethodsInterface
8793
{
8894
}

tests/CodeGen-Binding/Xamarin.Android.McwGen-Tests/java/com/xamarin/android/DefaultMethodsInterface.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ public interface DefaultMethodsInterface
77
default void setBar (int value) { }
88
default int toImplement () { throw new UnsupportedOperationException (); }
99
default int invokeFoo () { return foo (); }
10+
static int staticFoo () { return 0; }
1011
}

0 commit comments

Comments
 (0)