title: error FS0073: internal error: tcrefOfAppTy (Failure) - error when built on azure devops only
body: <p>I'm getting this error</p>
  <pre><code>error FS0073: internal error: tcrefOfAppTy (Failure) 
  </code></pre>
  <p>reported on this code</p>
  <pre><code>type ``Children``&lt;'a&gt; = abstract member ``Children`` : Unit -&gt; 'a
  
  [&lt;Extension&gt;]
  type Extensions =
      [&lt;Extension&gt;]
      static member Children&lt;'A, 'B when 'A :&gt; ``Children``&lt;'B&gt;&gt; (this: 'A) = 
          this.Children()
  
  let f2 a =
      a.Children()
  </code></pre>
  <p>apologies for the strange code, this is part of a much much bigger project with literally hundreds if not thousands of types (I'm wondering if that's the problem somehow)</p>
  <p>This code DID used to compile on azure devops on a &quot;windows-2019&quot; box, with dotnet core 3.x, against F# 5.0</p>
  <p>It doesnt compile (this project) on &quot;windows-2022&quot; box, since ive upgraded it to dotnetcore 6.0, F# 5, using a fake script. I notice the azure box uses visual studio enterprise</p>
  <pre><code>MSBuild version 17.3.0+f67e3d35e for .NET Framework
  </code></pre>
  <p>This code in this upgraded state, does compile in visual studio 2022, on my laptop, windows 11 pro.</p>
  <p>And also the same fake script works, though my machine has this</p>
  <pre><code>Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework
  </code></pre>
  <p>and runs visual studio professional.</p>
  <p>The devops logs contain this: (which looks a bit worrying)</p>
  <pre><code>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
  </code></pre>
  <p>and there's little clue online about what the error means.</p>
  <p>I think I'll upgrade my laptop to the latest visual studio and see if it breaks!</p>
  <p>(there are lots of variables here, I may boil this down to a much simpler project without thousands of types to see if i can isolate it, but at the moment I'm just looking for quick fixes/some educated guess as to what the cause is)</p>
  <p>There is a similar issue reported on the compiler</p>
  <p><a href="https://github.com/dotnet/fsharp/issues/13525" rel="nofollow noreferrer">https://github.com/dotnet/fsharp/issues/13525</a></p>
  <p>that effects C# extension methods.</p>
  <p>which is allegedly fixed (though which release I'm not sure), and in an associated issue there seems to be mention of dotnetcore 6.0.400, which both my laptop and my devops build are using.</p>