From ee93e0505d3a4b5d13be9bcc7596b6e6abf2d2fe Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Tue, 23 Nov 2021 18:57:30 +0800 Subject: [PATCH] UnmanagedCallersOnlyAttribute is unsupported (#12350) --- src/fsharp/TcGlobals.fs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs index 33f19c1861a..e6b819f448e 100755 --- a/src/fsharp/TcGlobals.fs +++ b/src/fsharp/TcGlobals.fs @@ -933,6 +933,12 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d | true, builder -> builder tinst | _ -> TType_app (tcref, tinst) + // Adding an unnecessary "let" instead of inlining into a muiti-line pipelined compute-once "member val" that is too complex for @dsyme + let v_attribs_Unsupported = [ + tryFindSysAttrib "System.Runtime.CompilerServices.ModuleInitializerAttribute" + tryFindSysAttrib "System.Runtime.CompilerServices.CallerArgumentExpressionAttribute" + tryFindSysAttrib "System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute" + ] |> List.choose (Option.map (fun x -> x.TyconRef)) override x.ToString() = "" member _.ilg=ilg @@ -1224,10 +1230,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member val attrib_CallerFilePathAttribute = findSysAttrib "System.Runtime.CompilerServices.CallerFilePathAttribute" member val attrib_CallerMemberNameAttribute = findSysAttrib "System.Runtime.CompilerServices.CallerMemberNameAttribute" member val attrib_SkipLocalsInitAttribute = findSysAttrib "System.Runtime.CompilerServices.SkipLocalsInitAttribute" - member val attribs_Unsupported = [ - tryFindSysAttrib "System.Runtime.CompilerServices.ModuleInitializerAttribute" - tryFindSysAttrib "System.Runtime.CompilerServices.CallerArgumentExpressionAttribute" - ] |> List.choose (Option.map (fun x -> x.TyconRef)) + member val attribs_Unsupported = v_attribs_Unsupported member val attrib_ProjectionParameterAttribute = mk_MFCore_attrib "ProjectionParameterAttribute" member val attrib_CustomOperationAttribute = mk_MFCore_attrib "CustomOperationAttribute"