Skip to content

Commit

Permalink
Merge pull request #17437 from dotnet/merges/main-to-release/dev17.12
Browse files Browse the repository at this point in the history
Merge main to release/dev17.12
  • Loading branch information
psfinaki authored Jul 24, 2024
2 parents 172ffdd + 1c07568 commit 588f8d6
Show file tree
Hide file tree
Showing 21 changed files with 48 additions and 64 deletions.
2 changes: 1 addition & 1 deletion src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ featureBooleanReturningAndReturnTypeDirectedPartialActivePattern,"Boolean-return
featureEnforceAttributeTargets,"Enforce AttributeTargets"
featureLowerInterpolatedStringToConcat,"Optimizes interpolated strings in certain cases, by lowering to concatenation"
featureLowerIntegralRangesToFastLoops,"Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops."
featureLowerSimpleMappingsInComprehensionsToDirectCallsToMap,"Lowers [for x in xs -> f x] and [|for x in xs -> f x|] to calls to List.map and Array.map when xs is a list or an array, respectively."
featureLowerSimpleMappingsInComprehensionsToFastLoops,"Lowers [for x in xs -> f x] and [|for x in xs -> f x|] to fast loops when xs is a list or an array, respectively."
3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation."
3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation."
3355,tcNotAnIndexerNamedIndexingNotYetEnabled,"The value '%s' is not a function and does not support index notation."
Expand Down
8 changes: 4 additions & 4 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ type LanguageFeature =
| EnforceAttributeTargets
| LowerInterpolatedStringToConcat
| LowerIntegralRangesToFastLoops
| LowerSimpleMappingsInComprehensionsToDirectCallsToMap
| LowerSimpleMappingsInComprehensionsToFastLoops
| ParsedHashDirectiveArgumentNonQuotes
| EmptyBodiedComputationExpressions

Expand Down Expand Up @@ -208,7 +208,7 @@ type LanguageVersion(versionText) =
LanguageFeature.EnforceAttributeTargets, previewVersion
LanguageFeature.LowerInterpolatedStringToConcat, previewVersion
LanguageFeature.LowerIntegralRangesToFastLoops, previewVersion
LanguageFeature.LowerSimpleMappingsInComprehensionsToDirectCallsToMap, previewVersion
LanguageFeature.LowerSimpleMappingsInComprehensionsToFastLoops, previewVersion
LanguageFeature.ParsedHashDirectiveArgumentNonQuotes, previewVersion
LanguageFeature.EmptyBodiedComputationExpressions, previewVersion
]
Expand Down Expand Up @@ -358,8 +358,8 @@ type LanguageVersion(versionText) =
| LanguageFeature.EnforceAttributeTargets -> FSComp.SR.featureEnforceAttributeTargets ()
| LanguageFeature.LowerInterpolatedStringToConcat -> FSComp.SR.featureLowerInterpolatedStringToConcat ()
| LanguageFeature.LowerIntegralRangesToFastLoops -> FSComp.SR.featureLowerIntegralRangesToFastLoops ()
| LanguageFeature.LowerSimpleMappingsInComprehensionsToDirectCallsToMap ->
FSComp.SR.featureLowerSimpleMappingsInComprehensionsToDirectCallsToMap ()
| LanguageFeature.LowerSimpleMappingsInComprehensionsToFastLoops ->
FSComp.SR.featureLowerSimpleMappingsInComprehensionsToFastLoops ()
| LanguageFeature.ParsedHashDirectiveArgumentNonQuotes -> FSComp.SR.featureParsedHashDirectiveArgumentNonString ()
| LanguageFeature.EmptyBodiedComputationExpressions -> FSComp.SR.featureEmptyBodiedComputationExpressions ()

Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Facilities/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type LanguageFeature =
| EnforceAttributeTargets
| LowerInterpolatedStringToConcat
| LowerIntegralRangesToFastLoops
| LowerSimpleMappingsInComprehensionsToDirectCallsToMap
| LowerSimpleMappingsInComprehensionsToFastLoops
| ParsedHashDirectiveArgumentNonQuotes
| EmptyBodiedComputationExpressions

Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Optimize/LowerComputedCollections.fs
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap ilTyForTy overallExpr
match overallSeqExpr with
// [for … in xs -> …] (* When xs is a list. *)
| SimpleMapping g (cont, (_, _, List g list, _, loopVal, body, ranges)) when
g.langVersion.SupportsFeature LanguageFeature.LowerSimpleMappingsInComprehensionsToDirectCallsToMap
g.langVersion.SupportsFeature LanguageFeature.LowerSimpleMappingsInComprehensionsToFastLoops
->
Some (cont (List.mkMap tcVal g amap m ranges list overallElemTy loopVal body))

Expand Down Expand Up @@ -669,7 +669,7 @@ let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap ilTyForTy overallExpr
match overallSeqExpr with
// [|for … in xs -> …|] (* When xs is an array. *)
| SimpleMapping g (cont, (ty1, ty2, Array g array, _, loopVal, body, ranges)) when
g.langVersion.SupportsFeature LanguageFeature.LowerSimpleMappingsInComprehensionsToDirectCallsToMap
g.langVersion.SupportsFeature LanguageFeature.LowerSimpleMappingsInComprehensionsToFastLoops
->
Some (cont (Array.mkMap g m ranges array (ilTyForTy ty1) (ilTyForTy ty2) overallElemTy loopVal body))

Expand Down
8 changes: 0 additions & 8 deletions src/Compiler/TypedTree/TcGlobals.fs
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,6 @@ type TcGlobals(
let v_range_step_generic_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeStepGeneric" , None , None , [vara;varb], ([[varaTy];[varbTy];[varaTy]], mkSeqTy varaTy))

let v_array_length_info = makeIntrinsicValRef(fslib_MFArrayModule_nleref, "length" , None , Some "Length" , [vara], ([[mkArrayType 1 varaTy]], v_int_ty))
let v_array_map_info = makeIntrinsicValRef(fslib_MFArrayModule_nleref, "map" , None , Some "Map" , [vara; varb], ([[varaTy --> varbTy]; [mkArrayType 1 varaTy]], mkArrayType 1 varbTy))
let v_array_get_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "GetArray" , None , None , [vara], ([[mkArrayType 1 varaTy]; [v_int_ty]], varaTy))
let v_array2D_get_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "GetArray2D" , None , None , [vara], ([[mkArrayType 2 varaTy];[v_int_ty]; [v_int_ty]], varaTy))
let v_array3D_get_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "GetArray3D" , None , None , [vara], ([[mkArrayType 3 varaTy];[v_int_ty]; [v_int_ty]; [v_int_ty]], varaTy))
Expand All @@ -847,8 +846,6 @@ type TcGlobals(
let v_array3D_set_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "SetArray3D" , None , None , [vara], ([[mkArrayType 3 varaTy];[v_int_ty]; [v_int_ty]; [v_int_ty]; [varaTy]], v_unit_ty))
let v_array4D_set_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "SetArray4D" , None , None , [vara], ([[mkArrayType 4 varaTy];[v_int_ty]; [v_int_ty]; [v_int_ty]; [v_int_ty]; [varaTy]], v_unit_ty))

let v_list_map_info = makeIntrinsicValRef(fslib_MFListModule_nleref, "map" , None , Some "Map" , [vara; varb], ([[varaTy --> varbTy]; [mkListTy varaTy]], mkListTy varbTy))

let v_option_toNullable_info = makeIntrinsicValRef(fslib_MFOptionModule_nleref, "toNullable" , None , Some "ToNullable" , [vara], ([[mkOptionTy varaTy]], mkNullableTy varaTy))
let v_option_defaultValue_info = makeIntrinsicValRef(fslib_MFOptionModule_nleref, "defaultValue" , None , Some "DefaultValue" , [vara], ([[varaTy]; [mkOptionTy varaTy]], varaTy))

Expand Down Expand Up @@ -1750,11 +1747,9 @@ type TcGlobals(
member val range_generic_op_vref = ValRefForIntrinsic v_range_generic_op_info
member val range_step_generic_op_vref = ValRefForIntrinsic v_range_step_generic_op_info
member val array_get_vref = ValRefForIntrinsic v_array_get_info
member val array_map_vref = ValRefForIntrinsic v_array_map_info
member val array2D_get_vref = ValRefForIntrinsic v_array2D_get_info
member val array3D_get_vref = ValRefForIntrinsic v_array3D_get_info
member val array4D_get_vref = ValRefForIntrinsic v_array4D_get_info
member val list_map_vref = ValRefForIntrinsic v_list_map_info
member val seq_singleton_vref = ValRefForIntrinsic v_seq_singleton_info
member val seq_collect_vref = ValRefForIntrinsic v_seq_collect_info
member val nativeptr_tobyref_vref = ValRefForIntrinsic v_nativeptr_tobyref_info
Expand Down Expand Up @@ -1815,7 +1810,6 @@ type TcGlobals(
member _.seq_to_array_info = v_seq_to_array_info

member _.array_length_info = v_array_length_info
member _.array_map_info = v_array_map_info
member _.array_get_info = v_array_get_info
member _.array2D_get_info = v_array2D_get_info
member _.array3D_get_info = v_array3D_get_info
Expand All @@ -1825,8 +1819,6 @@ type TcGlobals(
member _.array3D_set_info = v_array3D_set_info
member _.array4D_set_info = v_array4D_set_info

member _.list_map_info = v_list_map_info

member val option_toNullable_info = v_option_toNullable_info
member val option_defaultValue_info = v_option_defaultValue_info

Expand Down
4 changes: 0 additions & 4 deletions src/Compiler/TypedTree/TypedTreeOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7920,8 +7920,6 @@ let mkCallArrayLength (g: TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g

let mkCallArrayGet (g: TcGlobals) m ty e1 idx1 = mkApps g (typedExprForIntrinsic g m g.array_get_info, [[ty]], [ e1 ; idx1 ], m)

let mkCallArrayMap (g: TcGlobals) m ty1 ty2 e1 e2 = mkApps g (typedExprForIntrinsic g m g.array_map_info, [[ty1; ty2]], [ e1 ; e2 ], m)

let mkCallArray2DGet (g: TcGlobals) m ty e1 idx1 idx2 = mkApps g (typedExprForIntrinsic g m g.array2D_get_info, [[ty]], [ e1 ; idx1; idx2 ], m)

let mkCallArray3DGet (g: TcGlobals) m ty e1 idx1 idx2 idx3 = mkApps g (typedExprForIntrinsic g m g.array3D_get_info, [[ty]], [ e1 ; idx1; idx2; idx3 ], m)
Expand All @@ -7936,8 +7934,6 @@ let mkCallArray3DSet (g: TcGlobals) m ty e1 idx1 idx2 idx3 v = mkApps g (typedEx

let mkCallArray4DSet (g: TcGlobals) m ty e1 idx1 idx2 idx3 idx4 v = mkApps g (typedExprForIntrinsic g m g.array4D_set_info, [[ty]], [ e1 ; idx1; idx2; idx3; idx4; v ], m)

let mkCallListMap (g: TcGlobals) m ty1 ty2 e1 e2 = mkApps g (typedExprForIntrinsic g m g.list_map_info, [[ty1; ty2]], [ e1 ; e2 ], m)

let mkCallHash (g: TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.hash_info, [[ty]], [ e1 ], m)

let mkCallBox (g: TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.box_info, [[ty]], [ e1 ], m)
Expand Down
4 changes: 0 additions & 4 deletions src/Compiler/TypedTree/TypedTreeOps.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -2059,8 +2059,6 @@ val mkCallArrayLength: TcGlobals -> range -> TType -> Expr -> Expr

val mkCallArrayGet: TcGlobals -> range -> TType -> Expr -> Expr -> Expr

val mkCallArrayMap: g: TcGlobals -> m: range -> ty1: TType -> ty2: TType -> e1: Expr -> e2: Expr -> Expr

val mkCallArray2DGet: TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr

val mkCallArray3DGet: TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr
Expand All @@ -2075,8 +2073,6 @@ val mkCallArray3DSet: TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Exp

val mkCallArray4DSet: TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr

val mkCallListMap: g: TcGlobals -> m: range -> ty1: TType -> ty2: TType -> e1: Expr -> e2: Expr -> Expr

val mkCallHash: TcGlobals -> range -> TType -> Expr -> Expr

val mkCallBox: TcGlobals -> range -> TType -> Expr -> Expr
Expand Down
6 changes: 3 additions & 3 deletions src/Compiler/xlf/FSComp.txt.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Compiler/xlf/FSComp.txt.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Compiler/xlf/FSComp.txt.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Compiler/xlf/FSComp.txt.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Compiler/xlf/FSComp.txt.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Compiler/xlf/FSComp.txt.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Compiler/xlf/FSComp.txt.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 588f8d6

Please sign in to comment.