{
int rank = _rank;
- int uniquifier = 0;
RoType systemInt32 = Loader.GetCoreType(CoreType.Int32);
RoType elementType = GetRoElementType();
RoType systemVoid = Loader.GetCoreType(CoreType.Void);
{
getParameters[i] = systemInt32;
}
- yield return new RoSyntheticMethod(this, uniquifier++, "Get", elementType, getParameters);
+ yield return new RoSyntheticMethod(this, 0, "Get", elementType, getParameters);
}
if (filter == null || filter.Matches("Set"))
setParameters[i] = systemInt32;
}
setParameters[rank] = elementType;
- yield return new RoSyntheticMethod(this, uniquifier++, "Set", systemVoid, setParameters);
+ yield return new RoSyntheticMethod(this, 1, "Set", systemVoid, setParameters);
}
if (filter == null || filter.Matches("Address"))
{
addressParameters[i] = systemInt32;
}
- yield return new RoSyntheticMethod(this, uniquifier++, "Address", elementType.GetUniqueByRefType(), addressParameters);
+ yield return new RoSyntheticMethod(this, 2, "Address", elementType.GetUniqueByRefType(), addressParameters);
}
}
}
}
[Fact]
+ static void TestArrayGetMethodsResultEqualsFilteredGetMethod()
+ {
+ Type type = typeof(int[]).Project();
+
+ Assert.Equal(type.GetMethod("Get"), type.GetMethods().First(m => m.Name == "Get"));
+ Assert.Equal(type.GetMethod("Set"), type.GetMethods().First(m => m.Name == "Set"));
+ Assert.Equal(type.GetMethod("Address"), type.GetMethods().First(m => m.Name == "Address"));
+
+ Assert.NotEqual(type.GetMethod("Get"), type.GetMethods().First(m => m.Name == "Set"));
+ Assert.NotEqual(type.GetMethod("Set"), type.GetMethods().First(m => m.Name == "Address"));
+ Assert.NotEqual(type.GetMethod("Address"), type.GetMethods().First(m => m.Name == "Get"));
+ }
+
+ [Fact]
public static void TestArrayAddressMethod()
{
bool expectedDefaultValue = true;