You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure DevOps编译报FS0073: tcrefOfAppTy (Failure)错误求助

编译错误FS0073: tcrefOfAppTy (Failure) 排查与求助

错误信息

error FS0073: internal error: tcrefOfAppTy (Failure) 

出错代码

type ``Children``<'a> = abstract member ``Children`` : Unit -> 'a

[<Extension>]
type Extensions =
    [<Extension>]
    static member Children<'A, 'B when 'A :> ``Children``<'B>> (this: 'A) = 
        this.Children()

let f2 a =
    a.Children()

注:代码属于包含成百上千种类型的大型项目,怀疑项目规模可能与此错误相关。

环境差异

  • 原可编译环境:Azure DevOps Windows-2019、.NET Core 3.x、F# 5.0
  • 现失败环境:Azure DevOps Windows-2022、.NET 6.0、F# 5,使用FAKE脚本;Visual Studio Enterprise,MSBuild版本17.3.0+f67e3d35e for .NET Framework
  • 本地可编译环境:Windows 11 Pro笔记本、Visual Studio Professional、MSBuild版本17.2.1+52cd2da31 for .NET Framework,相同FAKE脚本可正常运行

异常堆栈日志

Unhandled Exception: System.Exception: tcrefOfAppTy
2022-08-29T10:32:08.1995442Z             at FSharp.Compiler.TypedTreeOps.tcrefOfAppTy(TcGlobals g, TType ty) in D:\a\_work\1\s\src\Compiler\TypedTree\TypedTreeOps.fs:line 877
2022-08-29T10:32:08.1997298Z             at FSharp.Compiler.AttributeChecking.CheckMethInfoAttributes[a](TcGlobals g, Range m, FSharpOption`1 tyargsOpt, MethInfo minfo) in D:\a\_work\1\s\src\Compiler\Checking\AttributeChecking.fs:line 403
2022-08-29T10:32:08.1999466Z             at FSharp.Compiler.MethodCalls.MethInfoChecks[a](TcGlobals g, ImportMap amap, Boolean isInstance, FSharpOption`1 tyargsOpt, FSharpList`1 objArgs, AccessorDomain ad, Range m, MethInfo minfo) in D:\a\_work\1\s\src\Compiler\Checking\MethodCalls.fs:line 1199
2022-08-29T10:32:08.2003101Z             at FSharp.Compiler.CheckExpressions.TcMethodApplication(Boolean isCheckingAttributeCall, TcFileState cenv, TcEnv env, UnscopedTyparEnv tpenv, FSharpOption`1 tyArgsOpt, FSharpList`1 objArgs, Range mMethExpr, Range mItem, String methodName, FSharpOption`1 objTyOpt, AccessorDomain ad, Mutates mut, Boolean isProp, FSharpList`1 calledMethsAndProps, AfterResolution afterResolution, ValUseFlag isSuperInit, FSharpList`1 curriedCallerArgs, OverallTy exprTy, FSharpList`1 delayed) in D:\a\_work\1\s\src\Compiler\Checking\CheckExpressions.fs:line 9661
2022-08-29T10:32:08.2007667Z             at FSharp.Compiler.CheckExpressions.TcMethodApplicationThen(TcFileState cenv, TcEnv env, OverallTy overallTy, FSharpOption`1 objTyOpt, UnscopedTyparEnv tpenv, FSharpOption`1 callerTyArgs, FSharpList`1 objArgs, Range m, Range mItem, String methodName, AccessorDomain ad, Mutates mut, Boolean isProp, FSharpList`1 meths, AfterResolution afterResolution, ValUseFlag isSuperInit, FSharpList`1 args, ExprAtomicFlag atomicFlag, FSharpList`1 delayed) in D:\a\_work\1\s\src\Compiler\Checking\CheckExpressions.fs:line 9169

当前进展与需求

  • 已计划升级本地Visual Studio到最新版,验证是否复现错误;同时考虑简化项目定位问题
  • 网上相关错误信息极少,希望获得快速修复方案或原因推测
  • 已知有涉及C#扩展方法的类似问题已修复,关联.NET 6.0.400版本,但本地与DevOps构建均使用该版本,仍出现差异

内容的提问来源于stack exchange,提问作者MrD at KookerellaLtd

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 13:06:28