From 488daff664e276b1bc8f0fa30d9b0bc7560b879b Mon Sep 17 00:00:00 2001 From: Copilot Date: Mon, 24 Aug 2026 10:47:09 +0200 Subject: [PATCH] Remove always-on BetterExceptionPrinting language feature flag The BetterExceptionPrinting feature was introduced in langversion 7.0 and is effectively always on. Delete the language feature flag from the DU, features map, GetFeatureString, and FSComp.txt, and collapse the single IlxGen enforcement gate to the unconditional path (keeping the three duplicate-Message correctness guards). xlf files regenerated by the build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Compiler/CodeGen/IlxGen.fs | 3 +-- 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(+), 72 deletions(-) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 8853bc9b1a8..85983d7dfb5 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -12868,8 +12868,7 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) : ILTypeRef option = yield! ilMethodDefsForProperties if - cenv.g.langVersion.SupportsFeature(LanguageFeature.BetterExceptionPrinting) - && not (exnc.HasMember g "get_Message" []) + not (exnc.HasMember g "get_Message" []) && not (exnc.HasMember g "Message" []) && not (fspecs |> List.exists (fun rf -> rf.DisplayNameCore = "Message")) then diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 7d960f43081..5d0fc6bda9f 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1253,7 +1253,6 @@ featureIndexerNotationWithoutDot,"expr[idx] notation for indexing and slicing" featureRefCellNotationInformationals,"informational messages related to reference cells" featureNonVariablePatternsToRightOfAsPatterns,"non-variable patterns to the right of 'as' patterns" featureAttributesToRightOfModuleKeyword,"attributes to the right of the 'module' keyword" -featureBetterExceptionPrinting,"automatic generation of 'Message' property for 'exception' declarations" featureDelegateTypeNameResolutionFix,"fix to resolution of delegate type names, see https://github.com/dotnet/fsharp/issues/10228" 3090,tcIfThenElseMayNotBeUsedWithinQueries,"An if/then/else expression may not be used within queries. Consider using either an if/then expression, or use a sequence expression instead." 3091,ilxgenUnexpectedArgumentToMethodHandleOfDuringCodegen,"Invalid argument to 'methodhandleof' during codegen" diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 3f395c70d2d..2644904f4c3 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -37,7 +37,6 @@ type LanguageFeature = | UnionIsPropertiesVisible | NonVariablePatternsToRightOfAsPatterns | AttributesToRightOfModuleKeyword - | BetterExceptionPrinting | DelegateTypeNameResolutionFix | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess @@ -171,7 +170,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) LanguageFeature.DelegateTypeNameResolutionFix, languageVersion60 // F# 7.0 - LanguageFeature.BetterExceptionPrinting, languageVersion70 LanguageFeature.ReallyLongLists, languageVersion70 LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess, languageVersion70 LanguageFeature.RequiredPropertiesSupport, languageVersion70 @@ -376,7 +374,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) | LanguageFeature.UnionIsPropertiesVisible -> FSComp.SR.featureUnionIsPropertiesVisible () | LanguageFeature.NonVariablePatternsToRightOfAsPatterns -> FSComp.SR.featureNonVariablePatternsToRightOfAsPatterns () | LanguageFeature.AttributesToRightOfModuleKeyword -> FSComp.SR.featureAttributesToRightOfModuleKeyword () - | LanguageFeature.BetterExceptionPrinting -> FSComp.SR.featureBetterExceptionPrinting () | LanguageFeature.DelegateTypeNameResolutionFix -> FSComp.SR.featureDelegateTypeNameResolutionFix () | LanguageFeature.ReallyLongLists -> FSComp.SR.featureReallyLongList () | LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess -> FSComp.SR.featureErrorOnDeprecatedRequireQualifiedAccess () diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 0ff7c5d3f30..6b55be1a6b3 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -27,7 +27,6 @@ type LanguageFeature = | UnionIsPropertiesVisible | NonVariablePatternsToRightOfAsPatterns | AttributesToRightOfModuleKeyword - | BetterExceptionPrinting | DelegateTypeNameResolutionFix | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 954242ece0f..1da43b219ff 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - automatické generování vlastnosti Message pro deklarace exception - - Boolean-returning and return-type-directed partial active patterns Částečné aktivní vzory vracející logickou hodnotu a směrované návratovým typem diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 80f830a16c5..c7fedaeb635 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - Automatische Generierung der Eigenschaft „Message“ für „exception“-Deklarationen - - Boolean-returning and return-type-directed partial active patterns Teilweise aktive boolesche Rückgabemuster und rückgabetypgesteuerte Muster diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 79228f89ca8..14460e6c338 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - generación automática de la propiedad 'Message' para declaraciones 'exception' - - Boolean-returning and return-type-directed partial active patterns Patrones activos parciales de devolución booleana y de tipo devuelto dirigido diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index cd3b1e1a536..0a9bba9a7b7 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - génération automatique de la propriété « Message » pour les déclarations « exception » - - Boolean-returning and return-type-directed partial active patterns Modèles actifs partiels à retour booléen et orientés par le type de retour diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 1c8f0c41984..ad7c7679435 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - generazione automatica della proprietà 'Messaggio' per le dichiarazioni 'eccezione' - - Boolean-returning and return-type-directed partial active patterns Criteri attivi parziali che restituiscono valori booleani e diretti dal tipo restituito diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index c3e9bb4a1db..cd42e64ecc4 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - `exception` 宣言の `Message` プロパティの自動生成 - - Boolean-returning and return-type-directed partial active patterns ブール値を返すパターンと、戻り値の型が指定された部分的アクティブパターン diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 7972da4a7a5..f5afdaf6f94 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - 'exception' 선언에 대한 'Message' 속성 자동 생성 - - Boolean-returning and return-type-directed partial active patterns 부울 반환 및 반환 형식 지향 부분 활성 패턴 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index eb8c28d658b..9a28ae365bf 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - Automatyczne generowanie właściwości „Wiadomość“ dla deklaracji „Wyjątek“ - - Boolean-returning and return-type-directed partial active patterns Zwracane wartości logiczne i zwracane częściowe wzorce aktywne kierowane do typu zwrotnego diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 1b31640b00c..6a1887637d3 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - geração automática da propriedade 'Message' para declarações de 'exception' - - Boolean-returning and return-type-directed partial active patterns Padrões ativos parciais com retorno booleano e direcionados por tipo de retorno diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 49afb609d19..f3bddbc4f1b 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - автоматическое создание свойства “Message” для объявлений “exception” - - Boolean-returning and return-type-directed partial active patterns Логические возвращаемые и направленные на возвращаемый тип частичные активные шаблоны diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 14562bf6520..6941af14e71 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - 'exception' bildirimleri için 'Message' özelliğinin otomatik olarak oluşturulması - - Boolean-returning and return-type-directed partial active patterns Boole döndüren ve dönüş türü yönlendiren kısmi etkin desenler diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index fd9cb13627e..1c87b0c9cdc 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - 自动生成“异常”声明的“消息”属性 - - Boolean-returning and return-type-directed partial active patterns 布尔返回模式和返回类型定向部分活动模式 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index d40692e0c1a..cb5fdaa6b47 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -337,11 +337,6 @@ Support for better anonymous record parsing - - automatic generation of 'Message' property for 'exception' declarations - 自動產生 'exception' 宣告的 'Message' 屬性 - - Boolean-returning and return-type-directed partial active patterns 布爾值傳回和傳回類型導向的部分現用模式