I'm running into an internal compiler error NUTC3028 when trying to compile a trivial UWP app in release mode with a dependency on the MathNet.Numerics NuGet package (PCL Profile7). Related Github Issue.
NUTC3028:Internal Compiler Error: Method
'instance Tuple<int, int, T, TOther>
DenseColumnMajorMatrixStorage<T>.Find2Unchecked<TOther>(MatrixStorage<TOther>,
Func<T,TOther,bool>, Zeros)'
on type
'DenseColumnMajorMatrixStorage<T>'
from assembly
'MathNet.Numerics'
tried to implicitly override a method with weaker type parameter
constraints while loading type
'DenseColumnMajorMatrixStorage<T>'.
while computing compilation roots.
DenseColumnMajorMatrixStorage<T>
inherits from MatrixStorage<T>
, both of them with the same constraint where T : struct, IEquatable<T>, IFormattable
.
override DenseColumnMajorMatrixStorage<T>.Find2Unchecked<TOther>(..)
overrides virtual MatrixStorage<T>.Find2Unchecked<TOther>(..)
, the latter with again the same constaint for the generic method type parameter: where TOther : struct, IEquatable<TOther>, IFormattable
. In C# it is not possible to change or even declare constraints when overriding, so there is no additional constraints in the overriding method.
I'm not quite following what type parameter constraints are supposed to be weaker; they look exactly the same to me. What am I missing?
Warning: reproducing this may take a while; on my machine ilc runs for roughly two hours (sic!) before failing with the error