1

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

Christoph Rüegg
  • 4,626
  • 1
  • 20
  • 34
  • If you haven't done so already, try building the app with the latest [Visual Studio Tools for Universal Windows Apps](https://www.visualstudio.com/en-us/news/vs2015-update1-vs.aspx#uniwinapps). If you can still reproduce the issue, I would suggest to report it to dotnetnative@microsoft.com. – Damir Arh Jan 04 '16 at 19:38
  • Yikes! I work on the .NET Native team and would like to take a look at this. Can you follow the instructions here? : https://github.com/dotnet/core/blob/master/Documentation/ilcRepro.md – MattWhilden Jan 05 '16 at 00:01

1 Answers1

2

I think this is corrected if you move to Windows Tools 1.3.1 (aka VS 2015 Update 2). You can see more discussion about it here: https://github.com/mathnet/mathnet-numerics/issues/361

Do let me know if you find that to not be the case.

MattWhilden
  • 1,686
  • 13
  • 18