IDE: VS 2015
Version: 8.4.96.2033
Target (If relevant): iOS
Description:
I’ve used double[] as vector to perform some animation arithmetic, and then I realize I can use mapped type feature to override operators of double[].
Then here’s a problem on iOS:
public __mapped class DoubleVector => double[] {
public static DoubleVector operator-(DoubleVector a) {
// test code
return a;
}
}
public class TestClass {
public static void test() {
DoubleVector a = new double[] { 1,2 };
// (E0) Internal error: Object reference not set to an instance of an object.
DoubleVector b = -a;
}
}