@@ -431,7 +431,7 @@ module TcRecdUnionAndEnumDeclarations =
431
431
let TcFieldDecl ( cenv : cenv ) env parent isIncrClass tpenv ( isStatic , synAttrs , id : Ident , nameGenerated , ty , isMutable , xmldoc , vis ) =
432
432
let g = cenv.g
433
433
let m = id.idRange
434
- let attrs , _ = TcAttributesWithPossibleTargets false cenv env AttributeTargets.FieldDecl synAttrs
434
+ let attrs , _ = TcAttributesWithPossibleTargets TcCanFail.ReportAllErrors cenv env AttributeTargets.FieldDecl synAttrs
435
435
436
436
let attrsForProperty , attrsForField = attrs |> List.partition ( fun ( attrTargets , _ ) -> ( attrTargets &&& AttributeTargets.Property) <> enum 0 )
437
437
let attrsForProperty = ( List.map snd attrsForProperty)
@@ -455,7 +455,7 @@ module TcRecdUnionAndEnumDeclarations =
455
455
match parent with
456
456
| Parent tcref when useGenuineField tcref.Deref rfspec ->
457
457
// Recheck the attributes for errors if the definition only generates a field
458
- TcAttributesWithPossibleTargets false cenv env AttributeTargets.FieldDeclRestricted synAttrs |> ignore
458
+ TcAttributesWithPossibleTargets TcCanFail.ReportAllErrors cenv env AttributeTargets.FieldDeclRestricted synAttrs |> ignore
459
459
| _ -> ()
460
460
rfspec
461
461
@@ -2909,9 +2909,9 @@ module EstablishTypeDefinitionCores =
2909
2909
2910
2910
if reportAttributeTargetsErrors then
2911
2911
if hasStructAttr then
2912
- TcAttributesWithPossibleTargets false cenv envinner AttributeTargets.Struct synAttrs |> ignore
2912
+ TcAttributesWithPossibleTargets TcCanFail.IgnoreMemberResoutionError cenv envinner AttributeTargets.Struct synAttrs |> ignore
2913
2913
else
2914
- TcAttributesWithPossibleTargets false cenv envinner AttributeTargets.Class synAttrs |> ignore
2914
+ TcAttributesWithPossibleTargets TcCanFail.IgnoreMemberResoutionError cenv envinner AttributeTargets.Class synAttrs |> ignore
2915
2915
2916
2916
// Note: the table of union cases is initially empty
2917
2917
Construct.MakeUnionRepr []
@@ -2934,9 +2934,9 @@ module EstablishTypeDefinitionCores =
2934
2934
2935
2935
if reportAttributeTargetsErrors then
2936
2936
if hasStructAttr then
2937
- TcAttributesWithPossibleTargets false cenv envinner AttributeTargets.Struct synAttrs |> ignore
2937
+ TcAttributesWithPossibleTargets TcCanFail.IgnoreMemberResoutionError cenv envinner AttributeTargets.Struct synAttrs |> ignore
2938
2938
else
2939
- TcAttributesWithPossibleTargets false cenv envinner AttributeTargets.Class synAttrs |> ignore
2939
+ TcAttributesWithPossibleTargets TcCanFail.IgnoreMemberResoutionError cenv envinner AttributeTargets.Class synAttrs |> ignore
2940
2940
2941
2941
// Note: the table of record fields is initially empty
2942
2942
TFSharpTyconRepr ( Construct.NewEmptyFSharpTyconData TFSharpRecord)
@@ -2952,19 +2952,19 @@ module EstablishTypeDefinitionCores =
2952
2952
match kind with
2953
2953
| SynTypeDefnKind.Class ->
2954
2954
if reportAttributeTargetsErrors then
2955
- TcAttributesWithPossibleTargets false cenv envinner AttributeTargets.Class synAttrs |> ignore
2955
+ TcAttributesWithPossibleTargets TcCanFail.IgnoreMemberResoutionError cenv envinner AttributeTargets.Class synAttrs |> ignore
2956
2956
TFSharpClass
2957
2957
| SynTypeDefnKind.Interface ->
2958
2958
if reportAttributeTargetsErrors then
2959
- TcAttributesWithPossibleTargets false cenv envinner AttributeTargets.Interface synAttrs |> ignore
2959
+ TcAttributesWithPossibleTargets TcCanFail.IgnoreMemberResoutionError cenv envinner AttributeTargets.Interface synAttrs |> ignore
2960
2960
TFSharpInterface
2961
2961
| SynTypeDefnKind.Delegate _ ->
2962
2962
if reportAttributeTargetsErrors then
2963
- TcAttributesWithPossibleTargets false cenv envinner AttributeTargets.Delegate synAttrs |> ignore
2963
+ TcAttributesWithPossibleTargets TcCanFail.IgnoreMemberResoutionError cenv envinner AttributeTargets.Delegate synAttrs |> ignore
2964
2964
TFSharpDelegate ( MakeSlotSig( " Invoke" , g.unit_ ty, [], [], [], None))
2965
2965
| SynTypeDefnKind.Struct ->
2966
2966
if reportAttributeTargetsErrors then
2967
- TcAttributesWithPossibleTargets false cenv envinner AttributeTargets.Struct synAttrs |> ignore
2967
+ TcAttributesWithPossibleTargets TcCanFail.IgnoreMemberResoutionError cenv envinner AttributeTargets.Struct synAttrs |> ignore
2968
2968
TFSharpStruct
2969
2969
| _ -> error( InternalError( " should have inferred tycon kind" , m))
2970
2970
@@ -2973,7 +2973,7 @@ module EstablishTypeDefinitionCores =
2973
2973
| SynTypeDefnSimpleRepr.Enum _ ->
2974
2974
noCLIMutableAttributeCheck()
2975
2975
if reportAttributeTargetsErrors then
2976
- TcAttributesWithPossibleTargets false cenv envinner AttributeTargets.Enum synAttrs |> ignore
2976
+ TcAttributesWithPossibleTargets TcCanFail.IgnoreMemberResoutionError cenv envinner AttributeTargets.Enum synAttrs |> ignore
2977
2977
TFSharpTyconRepr ( Construct.NewEmptyFSharpTyconData TFSharpEnum)
2978
2978
2979
2979
// OK, now fill in the (partially computed) type representation
@@ -4035,7 +4035,7 @@ module EstablishTypeDefinitionCores =
4035
4035
// Phase 1B. Establish the kind of each type constructor
4036
4036
// Here we run InferTyconKind and record partial information about the kind of the type constructor.
4037
4037
// This means FSharpTyconKind is set, which means isSealedTy, isInterfaceTy etc. give accurate results.
4038
- let withAttrs =
4038
+ let withAttrs =
4039
4039
( envMutRecPrelim, withEnvs) ||> MutRecShapes.mapTyconsWithEnv ( fun envForDecls ( origInfo , tyconOpt ) ->
4040
4040
let res =
4041
4041
match origInfo, tyconOpt with
@@ -5202,7 +5202,7 @@ let TcModuleOrNamespaceElementsMutRec (cenv: cenv) parent typeNames m envInitial
5202
5202
let mutRecDefnsChecked , envAfter = TcDeclarations.TcMutRecDefinitions cenv envInitial parent typeNames tpenv m scopem mutRecNSInfo mutRecDefns true
5203
5203
5204
5204
// Check the assembly attributes
5205
- let attrs , _ = TcAttributesWithPossibleTargets false cenv envAfter AttributeTargets.Top synAttrs
5205
+ let attrs , _ = TcAttributesWithPossibleTargets TcCanFail.ReportAllErrors cenv envAfter AttributeTargets.Top synAttrs
5206
5206
5207
5207
// Check the non-escaping condition as we build the list of module expressions on the way back up
5208
5208
let moduleContents = TcMutRecDefsFinish cenv mutRecDefnsChecked m
@@ -5279,7 +5279,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem
5279
5279
return ! failwith " unreachable"
5280
5280
5281
5281
| SynModuleDecl.Attributes ( Attributes synAttrs, _) ->
5282
- let attrs , _ = TcAttributesWithPossibleTargets false cenv env AttributeTargets.Top synAttrs
5282
+ let attrs , _ = TcAttributesWithPossibleTargets TcCanFail.ReportAllErrors cenv env AttributeTargets.Top synAttrs
5283
5283
return ([], [], attrs), env, env
5284
5284
5285
5285
| SynModuleDecl.HashDirective _ ->
0 commit comments