【问题标题】:.Net Native Internal Compiler Error NUTC3028 when overriding mixed generic methods.Net Native 内部编译器错误 NUTC3028 覆盖混合泛型方法时
【发布时间】: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&lt;T&gt; 继承自 MatrixStorage&lt;T&gt;,它们都具有相同的约束 where T : struct, IEquatable&lt;T&gt;, IFormattable

override DenseColumnMajorMatrixStorage&lt;T&gt;.Find2Unchecked&lt;TOther&gt;(..) 覆盖virtual MatrixStorage&lt;T&gt;.Find2Unchecked&lt;TOther&gt;(..),后者再次具有相同的泛型方法类型参数约束:where TOther : struct, IEquatable&lt;TOther&gt;, IFormattable。在 C# 中,重写时无法更改甚至声明约束,因此在重写方法中没有额外的约束。

我并没有完全遵循应该更弱的类型参数约束;它们在我看来完全一样。我错过了什么?

警告:复制此内容可能需要一段时间;在我的机器上,ilc 运行了大约两个小时(原文如此!),然后出现错误

【问题讨论】:

标签: c# uwp mathnet-numerics coreclr .net-native


【解决方案1】:

我认为如果您迁移到 Windows 工具 1.3.1(又名 VS 2015 Update 2),这将得到纠正。你可以在这里看到更多关于它的讨论:https://github.com/mathnet/mathnet-numerics/issues/361

如果您发现情况并非如此,请告诉我。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-12-09
    • 1970-01-01
    • 2012-06-18
    • 1970-01-01
    • 1970-01-01
    • 2021-11-22
    • 2017-03-16
    • 1970-01-01
    相关资源
    最近更新 更多