diff --git a/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md index e11e34a5c88..6745b881aaf 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md @@ -162,6 +162,7 @@ * Support for the `` XML documentation tag: at compile time, documentation is copied from an external XML file selected by an XPath query and emitted into the generated documentation file. `` remains unsupported. ([Issue #19175](https://github.com/dotnet/fsharp/issues/19175), [PR #19186](https://github.com/dotnet/fsharp/pull/19186)) * Expand `` at tooling time. In IDE tooltips, completion, and signature help, documentation is inherited from base classes, interfaces, overridden members, and constructors (matched by parameter signature). The FCS Symbols API (`FSharpSymbol.XmlDoc`) additionally resolves explicit `cref` targets, but does not expand constructor inheritance. The compiler emits the tag verbatim into generated XML documentation files, matching C#; `` is not implemented. ([Issue #19175](https://github.com/dotnet/fsharp/issues/19175), [PR #19188](https://github.com/dotnet/fsharp/pull/19188)) * Add symbol and type highlighting to F# diagnostics ([PR #20097](https://github.com/dotnet/fsharp/pull/20097)) +* IL: reuse the cached ILTypeRef in ILTypeInfo.FromType ([PR #20255](https://github.com/dotnet/fsharp/pull/20255)) ### Improved diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 5f9d4f41ba4..b9fba8f548c 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -461,14 +461,12 @@ type ILTypeInfo = let metadataTy = convertToTypeWithMetadataIfPossible g ty assert (isILAppTy g metadataTy) let metadataTyconRef = tcrefOfAppTy g metadataTy - let (TILObjectReprData(scoref, enc, tdef)) = metadataTyconRef.ILTyconInfo - let metadataILTypeRef = mkRefForNestedILTypeDef scoref (enc, tdef) - ILTypeInfo(g, ty, metadataILTypeRef, tdef) + let (TILObjectReprData(_, _, tdef)) = metadataTyconRef.ILTyconInfo + ILTypeInfo(g, ty, metadataTyconRef.CompiledRepresentationForNamedType, tdef) elif isILAppTy g ty then let tcref = tcrefOfAppTy g ty - let (TILObjectReprData(scoref, enc, tdef)) = tcref.ILTyconInfo - let tref = mkRefForNestedILTypeDef scoref (enc, tdef) - ILTypeInfo(g, ty, tref, tdef) + let (TILObjectReprData(_, _, tdef)) = tcref.ILTyconInfo + ILTypeInfo(g, ty, tcref.CompiledRepresentationForNamedType, tdef) else failwith ("ILTypeInfo.FromType - no IL metadata for type" + Environment.StackTrace) @@ -2652,4 +2650,4 @@ let (|DifferentGetterAndSetter|_|) (pinfo: PropInfo) = // Getter has an index parameter getValReprInfo.TotalArgCount > 1 -> ValueSome (getValRef, setValRef) | _ -> ValueNone - | _ -> ValueNone \ No newline at end of file + | _ -> ValueNone