Skip to content

Commit ee93e05

Browse files
authored
UnmanagedCallersOnlyAttribute is unsupported (#12350)
1 parent edd4c3b commit ee93e05

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/fsharp/TcGlobals.fs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,12 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d
933933
| true, builder -> builder tinst
934934
| _ -> TType_app (tcref, tinst)
935935

936+
// Adding an unnecessary "let" instead of inlining into a muiti-line pipelined compute-once "member val" that is too complex for @dsyme
937+
let v_attribs_Unsupported = [
938+
tryFindSysAttrib "System.Runtime.CompilerServices.ModuleInitializerAttribute"
939+
tryFindSysAttrib "System.Runtime.CompilerServices.CallerArgumentExpressionAttribute"
940+
tryFindSysAttrib "System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute"
941+
] |> List.choose (Option.map (fun x -> x.TyconRef))
936942

937943
override x.ToString() = "<TcGlobals>"
938944
member _.ilg=ilg
@@ -1224,10 +1230,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d
12241230
member val attrib_CallerFilePathAttribute = findSysAttrib "System.Runtime.CompilerServices.CallerFilePathAttribute"
12251231
member val attrib_CallerMemberNameAttribute = findSysAttrib "System.Runtime.CompilerServices.CallerMemberNameAttribute"
12261232
member val attrib_SkipLocalsInitAttribute = findSysAttrib "System.Runtime.CompilerServices.SkipLocalsInitAttribute"
1227-
member val attribs_Unsupported = [
1228-
tryFindSysAttrib "System.Runtime.CompilerServices.ModuleInitializerAttribute"
1229-
tryFindSysAttrib "System.Runtime.CompilerServices.CallerArgumentExpressionAttribute"
1230-
] |> List.choose (Option.map (fun x -> x.TyconRef))
1233+
member val attribs_Unsupported = v_attribs_Unsupported
12311234

12321235
member val attrib_ProjectionParameterAttribute = mk_MFCore_attrib "ProjectionParameterAttribute"
12331236
member val attrib_CustomOperationAttribute = mk_MFCore_attrib "CustomOperationAttribute"

0 commit comments

Comments
 (0)