From eabb4598250de3bc09c6137a1b1fee38dd6354db Mon Sep 17 00:00:00 2001 From: Copilot Date: Wed, 26 Aug 2026 16:07:47 +0200 Subject: [PATCH] Remove always-on language feature flag PreferStringGetPinnableReference (#20186) The PreferStringGetPinnableReference feature shipped in F# 8.0 and is on for every selectable language version (minimum langversion is 8.0), so its flag is dead configuration. Remove the LanguageFeature DU case, features-map entry, GetFeatureString arm, FSComp.txt resource string, and collapse the single guarded path in TcAndBuildFixedExpr to the always-on GetPinnableReference call. Regenerate xlf files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Compiler/Checking/Expressions/CheckExpressions.fs | 8 +------- src/Compiler/FSComp.txt | 1 - src/Compiler/Facilities/LanguageFeatures.fs | 3 --- src/Compiler/Facilities/LanguageFeatures.fsi | 1 - src/Compiler/xlf/FSComp.txt.cs.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.de.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.es.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.fr.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.it.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.ja.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.ko.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.pl.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.ru.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.tr.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 ----- 17 files changed, 1 insertion(+), 77 deletions(-) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 02fe8f3bd29..0bb45696ce1 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -11420,13 +11420,7 @@ and TcAndBuildFixedExpr (cenv: cenv) env (overallPatTy, fixedExpr, overallExprTy mkConvToNativeInt g ve mBinding) | ty when isStringTy g ty -> - let getPinnableRefCall = - if g.langVersion.SupportsFeature LanguageFeature.PreferStringGetPinnableReference then - tryBuildGetPinnableReferenceCall () - else - None - - match getPinnableRefCall with + match tryBuildGetPinnableReferenceCall () with | Some expr -> expr | None -> let charPtrTy = mkNativePtrTy g g.char_ty diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index f357d733f74..2871eec30b9 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1593,7 +1593,6 @@ featureImprovedImpliedArgumentNames,"Improved implied argument names" featureConstraintIntersectionOnFlexibleTypes,"Constraint intersection on flexible types" featureChkNotTailRecursive,"Raises warnings if a member or function has the 'TailCall' attribute, but is not being used in a tail recursive way." featureExtendedFixedBindings,"extended fixed bindings for byref and GetPinnableReference" -featurePreferStringGetPinnableReference,"prefer String.GetPinnableReference in fixed bindings" featurePreferExtensionMethodOverPlainProperty,"prefer extension method over plain property" featureWarningIndexedPropertiesGetSetSameType,"Indexed properties getter and setter must have the same type" featureChkTailCallAttrOnNonRec,"Raises warnings if the 'TailCall' attribute is used on non-recursive functions." diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index ab6ace19aae..ead22095fa5 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -59,7 +59,6 @@ type LanguageFeature = | UnmanagedConstraintCsharpInterop | ReuseSameFieldsInStructUnions | ExtendedFixedBindings - | PreferStringGetPinnableReference | PreferExtensionMethodOverPlainProperty | WarningIndexedPropertiesGetSetSameType | WarningWhenTailCallAttrOnNonRec @@ -181,7 +180,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) LanguageFeature.StaticLetInRecordsDusEmptyTypes, languageVersion80 LanguageFeature.ConstraintIntersectionOnFlexibleTypes, languageVersion80 LanguageFeature.ExtendedFixedBindings, languageVersion80 - LanguageFeature.PreferStringGetPinnableReference, languageVersion80 // F# 9.0 LanguageFeature.NullnessChecking, languageVersion90 @@ -377,7 +375,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) | LanguageFeature.UnmanagedConstraintCsharpInterop -> FSComp.SR.featureUnmanagedConstraintCsharpInterop () | LanguageFeature.ReuseSameFieldsInStructUnions -> FSComp.SR.featureReuseSameFieldsInStructUnions () | LanguageFeature.ExtendedFixedBindings -> FSComp.SR.featureExtendedFixedBindings () - | LanguageFeature.PreferStringGetPinnableReference -> FSComp.SR.featurePreferStringGetPinnableReference () | LanguageFeature.PreferExtensionMethodOverPlainProperty -> FSComp.SR.featurePreferExtensionMethodOverPlainProperty () | LanguageFeature.WarningIndexedPropertiesGetSetSameType -> FSComp.SR.featureWarningIndexedPropertiesGetSetSameType () | LanguageFeature.WarningWhenTailCallAttrOnNonRec -> FSComp.SR.featureChkTailCallAttrOnNonRec () diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index f19abbb861e..e3a59c7b78d 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -49,7 +49,6 @@ type LanguageFeature = | UnmanagedConstraintCsharpInterop | ReuseSameFieldsInStructUnions | ExtendedFixedBindings - | PreferStringGetPinnableReference /// RFC-1137 | PreferExtensionMethodOverPlainProperty | WarningIndexedPropertiesGetSetSameType diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index dc4782c9ed4..74cf72f35e3 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -572,11 +572,6 @@ preferovat metodu rozšíření před prostými vlastnostmi - - prefer String.GetPinnableReference in fixed bindings - preferovat String.GetPinnableReference v pevných vazbách - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 4cb29a257b1..138eaa912c4 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -572,11 +572,6 @@ Erweiterungsmethode gegenüber plain-Eigenschaft bevorzugen - - prefer String.GetPinnableReference in fixed bindings - String.GetPinnableReference in festen Bindungen bevorzugen - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 3c9a547190c..8fac16e4436 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -572,11 +572,6 @@ preferir método de extensión sobre propiedad sin formato - - prefer String.GetPinnableReference in fixed bindings - preferir String.GetPinnableReference en enlaces fijos - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 4fa634e0bf4..baa5bd979af 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -572,11 +572,6 @@ préférer la méthode d’extension à la propriété simple - - prefer String.GetPinnableReference in fixed bindings - préférez String.GetPinnableReference dans les liaisons fixes - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 847a812bca6..d95463749e4 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -572,11 +572,6 @@ preferisci il metodo di estensione alla proprietà normale - - prefer String.GetPinnableReference in fixed bindings - preferisci String.GetPinnableReference nei binding fissi - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 1984f24be07..0e70ce23066 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -572,11 +572,6 @@ plain プロパティよりも拡張メソッドを優先する - - prefer String.GetPinnableReference in fixed bindings - 固定バインドで String.GetPinnableReference を優先する - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 1c926d2f636..849c11ba16a 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -572,11 +572,6 @@ 일반 속성보다 확장 메서드 선호 - - prefer String.GetPinnableReference in fixed bindings - 고정 바인딩에서 String.GetPinnableReference 선호 - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 184e743f9ab..4d591f8bd4a 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -572,11 +572,6 @@ preferuj metodę rozszerzenia nad zwykłą właściwością - - prefer String.GetPinnableReference in fixed bindings - preferuj element String.GetPinnableReference w stałych powiązaniach - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index d45561696cc..e6378ce8e53 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -572,11 +572,6 @@ preferir o método de extensão em vez da propriedade simples - - prefer String.GetPinnableReference in fixed bindings - preferir String.GetPinnableReference em associações fixas - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index a354c753312..35833c9883a 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -572,11 +572,6 @@ предпочитать метод расширения вместо простого свойства - - prefer String.GetPinnableReference in fixed bindings - рекомендуется использовать String.GetPinnableReference в фиксированных привязках - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 8eee8e0f00b..2c0acb42221 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -572,11 +572,6 @@ Basit özellik yerine genişletme yöntemini tercih edin - - prefer String.GetPinnableReference in fixed bindings - sabit bağlamalarda String.GetPinnableReference tercih edin - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 8b416bf6648..30a3888a60d 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -572,11 +572,6 @@ 首选扩展方法而不是纯属性 - - prefer String.GetPinnableReference in fixed bindings - 在固定绑定中首选 String.GetPinnableReference - - #elif preprocessor directive #elif preprocessor directive diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index c8848815e00..1c6a1dd5a96 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -572,11 +572,6 @@ 偏好延伸模組方法勝於純文字屬性 - - prefer String.GetPinnableReference in fixed bindings - 在固定繫結中優先使用 String.GetPinnableReference - - #elif preprocessor directive #elif preprocessor directive