Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfrijters <jfrijters>2015-06-29 13:06:14 +0300
committerjfrijters <jfrijters>2015-06-29 13:06:14 +0300
commit51969ec73b9e0d4a0a55fb85674789c0f13d22e1 (patch)
treec3f63f3b13b357d738f25d9660acff4743c5f078
parent174e87b1dad287bc3b2231cd9e3c1c99867c1fc4 (diff)
Emit warning if property getter/setter is missing.
-rw-r--r--runtime/MemberWrapper.cs22
1 files changed, 14 insertions, 8 deletions
diff --git a/runtime/MemberWrapper.cs b/runtime/MemberWrapper.cs
index 0778e0d4..e74283a8 100644
--- a/runtime/MemberWrapper.cs
+++ b/runtime/MemberWrapper.cs
@@ -1804,7 +1804,7 @@ namespace IKVM.Internal
{
if(getter == null)
{
- EmitThrowNoSuchMethodErrorForGetter(ilgen, this.FieldTypeWrapper, this.IsStatic);
+ EmitThrowNoSuchMethodErrorForGetter(ilgen, this.FieldTypeWrapper, this);
}
else if(getter.IsStatic)
{
@@ -1816,15 +1816,18 @@ namespace IKVM.Internal
}
}
- internal static void EmitThrowNoSuchMethodErrorForGetter(CodeEmitter ilgen, TypeWrapper type, bool isStatic)
+ internal static void EmitThrowNoSuchMethodErrorForGetter(CodeEmitter ilgen, TypeWrapper type, MemberWrapper member)
{
+#if STATIC_COMPILER
+ StaticCompiler.IssueMessage(Message.EmittedNoSuchMethodError, "<unknown>", member.DeclaringType.Name + "." + member.Name + member.Signature);
+#endif
// HACK the branch around the throw is to keep the verifier happy
CodeEmitterLabel label = ilgen.DefineLabel();
ilgen.Emit(OpCodes.Ldc_I4_0);
ilgen.EmitBrtrue(label);
ilgen.EmitThrow("java.lang.NoSuchMethodError");
ilgen.MarkLabel(label);
- if (!isStatic)
+ if (!member.IsStatic)
{
ilgen.Emit(OpCodes.Pop);
}
@@ -1845,7 +1848,7 @@ namespace IKVM.Internal
}
else
{
- EmitThrowNoSuchMethodErrorForSetter(ilgen, this.IsStatic);
+ EmitThrowNoSuchMethodErrorForSetter(ilgen, this);
}
}
else if(setter.IsStatic)
@@ -1858,8 +1861,11 @@ namespace IKVM.Internal
}
}
- internal static void EmitThrowNoSuchMethodErrorForSetter(CodeEmitter ilgen, bool isStatic)
+ internal static void EmitThrowNoSuchMethodErrorForSetter(CodeEmitter ilgen, MemberWrapper member)
{
+#if STATIC_COMPILER
+ StaticCompiler.IssueMessage(Message.EmittedNoSuchMethodError, "<unknown>", member.DeclaringType.Name + "." + member.Name + member.Signature);
+#endif
// HACK the branch around the throw is to keep the verifier happy
CodeEmitterLabel label = ilgen.DefineLabel();
ilgen.Emit(OpCodes.Ldc_I4_0);
@@ -1867,7 +1873,7 @@ namespace IKVM.Internal
ilgen.EmitThrow("java.lang.NoSuchMethodError");
ilgen.MarkLabel(label);
ilgen.Emit(OpCodes.Pop);
- if (!isStatic)
+ if (!member.IsStatic)
{
ilgen.Emit(OpCodes.Pop);
}
@@ -1913,7 +1919,7 @@ namespace IKVM.Internal
MethodInfo getter = property.GetGetMethod(true);
if(getter == null)
{
- DynamicPropertyFieldWrapper.EmitThrowNoSuchMethodErrorForGetter(ilgen, this.FieldTypeWrapper, this.IsStatic);
+ DynamicPropertyFieldWrapper.EmitThrowNoSuchMethodErrorForGetter(ilgen, this.FieldTypeWrapper, this);
}
else if(getter.IsStatic)
{
@@ -1940,7 +1946,7 @@ namespace IKVM.Internal
}
else
{
- DynamicPropertyFieldWrapper.EmitThrowNoSuchMethodErrorForSetter(ilgen, this.IsStatic);
+ DynamicPropertyFieldWrapper.EmitThrowNoSuchMethodErrorForSetter(ilgen, this);
}
}
else if(setter.IsStatic)