Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat test.java
- interface I1 { int getP (); }
- interface I2 { int getP (); }
- interface I3 extends I1, I2 {}
- class C
- {
- static int M ()
- {
- I3 o = null;
- return o.getP ();
- }
- }
- $ cat test.cs
- public interface I1 { int GetP (); }
- public interface I2 { int GetP (); }
- public interface I3 : I1, I2 {}
- public class C
- {
- static int M ()
- {
- return default (I3).GetP ();
- }
- }
- $ javac test.java
- $ mcs test.cs
- test.cs(9,24): warning CS1720: Expression will always cause a `System.NullReferenceException'
- test.cs(9,37): error CS0121: The call is ambiguous between the following methods or properties: `I1.GetP()' and `I2.GetP()'
- test.cs(1,27): (Location of the symbol related to previous error)
- test.cs(2,27): (Location of the symbol related to previous error)
- error CS5001: Program `test.exe' does not contain a static `Main' method suitable for an entry point
- Compilation failed: 2 error(s), 1 warnings
Advertisement
Add Comment
Please, Sign In to add comment