【发布时间】:2016-01-04 18:41:42
【问题描述】:
当我尝试在发布模式下编译一个依赖于MathNet.Numerics NuGet 包 (PCL Profile7) 的普通 UWP 应用程序时,遇到了内部编译器错误 NUTC3028。 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> 继承自 MatrixStorage<T>,它们都具有相同的约束 where T : struct, IEquatable<T>, IFormattable。
override DenseColumnMajorMatrixStorage<T>.Find2Unchecked<TOther>(..) 覆盖virtual MatrixStorage<T>.Find2Unchecked<TOther>(..),后者再次具有相同的泛型方法类型参数约束:where TOther : struct, IEquatable<TOther>, IFormattable。在 C# 中,重写时无法更改甚至声明约束,因此在重写方法中没有额外的约束。
我并没有完全遵循应该更弱的类型参数约束;它们在我看来完全一样。我错过了什么?
警告:复制此内容可能需要一段时间;在我的机器上,ilc 运行了大约两个小时(原文如此!),然后出现错误
【问题讨论】:
-
如果您还没有这样做,请尝试使用最新的Visual Studio Tools for Universal Windows Apps 构建应用程序。如果您仍然可以重现该问题,我建议您将其报告给 dotnetnative@microsoft.com。
-
哎呀!我在 .NET Native 团队工作,想看看这个。您能按照这里的说明进行操作吗? :github.com/dotnet/core/blob/master/Documentation/ilcRepro.md
标签: c# uwp mathnet-numerics coreclr .net-native