if (idxlen >= 0 && idxlen != args.Length)
continue;
- if (haveRet && !check_type (p.PropertyType, returnType))
+ if (haveRet && p.PropertyType != returnType)
continue;
int score = Int32.MaxValue - 1;
+2008-06-02 Ivan N. Zlatev <contact@i-nz.net>
+
+ * Binder.cs, MonoGenericClass.cs: For property reflection we should
+ strictly match the return type if available.
+
2008-05-16 Zoltan Varga <vargaz@gmail.com>
* MonoGenericClass.cs (GetConstructor): Remove some old code, as the new code
int count = props.Length;
- if (count == 1 && (types == null || types.Length == 0))
+ if (count == 1 && (types == null || types.Length == 0) &&
+ (returnType == null || returnType == props[0].PropertyType))
return props [0];
if (binder == null)
+2008-06-02 Ivan N. Zlatev <contact@i-nz.net>
+
+ * MonoType.cs: For property reflection we should strictly match the return
+ type if available.
+
2008-06-01 Juraj Skripsky <js@hotfeet.ch>
* String.cs (Substring): Blocking bug #395904 has been fixed,
if (count == 0)
return null;
- if (count == 1 && (types == null || types.Length == 0))
+ if (count == 1 && (types == null || types.Length == 0) &&
+ (returnType == null || returnType == props[0].PropertyType))
return props [0];
if (binder == null)
+2008-06-02 Ivan N. Zlatev <contact@i-nz.net>
+
+ * TypeTest.cs: Add tests to verify strict return type matching of
+ property reflection.
+
2008-06-01 Juraj Skripsky <js@hotfeet.ch>
* StringTest.cs (Substring2): Blocking bug #395904 has been fixed,
}
}
+ [Test]
+ public void GetProperty8_PropertyType ()
+ {
+ Type type = typeof (Bar);
+ Assert.IsNull (type.GetProperty ("PubInst", BindingFlags.Public | BindingFlags.Instance,
+ null, typeof (int), Type.EmptyTypes, null), "#1");
+ Assert.IsNotNull (type.GetProperty ("PubInst", BindingFlags.Public | BindingFlags.Instance, null,
+ typeof (long), new Type[0], null), "#2");
+ }
+
#if !TARGET_JVM // StructLayout not supported for TARGET_JVM
[StructLayout(LayoutKind.Explicit, Pack = 4, Size = 64)]
public class Class1