From 7df4dd9e16792d81f88c0372af6e346620b3814e Mon Sep 17 00:00:00 2001 From: Copilot Date: Tue, 6 Oct 2026 16:53:49 +0200 Subject: [PATCH] Remove always-on WarningWhenMultipleRecdTypeChoice language feature flag --- src/Compiler/Checking/NameResolution.fs | 5 +---- src/Compiler/FSComp.txt | 8 +++++++- src/Compiler/Facilities/LanguageFeatures.fs | 15 ++++++++++++--- src/Compiler/Facilities/LanguageFeatures.fsi | 5 ++++- 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, 24 insertions(+), 74 deletions(-) diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index a80bbe04c65..556f3077da9 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -3265,10 +3265,7 @@ let rec ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind (resInf |> fun a -> System.String.Join("\n", a) let message = FSComp.SR.tcMultipleRecdTypeChoice(RichText.mkText candidates, richTextOfEntityRefName tcref resolvedTypeName, RichText.mkText overlappingNames) - if g.langVersion.SupportsFeature(LanguageFeature.WarningWhenMultipleRecdTypeChoice) then - warning(Error(message, m)) - else - informationalWarning(Error(message, m)) + warning(Error(message, m)) | _ -> () FSComp.SR.undefinedNameFieldConstructorOrMemberWhenTypeIsKnown(richTextOfEntityRefName tcref tcref.DisplayNameWithStaticParametersAndUnderscoreTypars, s) | ValueSome tcref -> diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 1ebca3aa194..74a39ae901e 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1532,6 +1532,7 @@ csTypeHasNullAsTrueValue,"The type '%s' uses 'null' as a representation value bu csTypeHasNullAsExtraValue,"The type '%s' supports 'null' but a non-null type is expected" 3300,chkInvalidFunctionParameterType,"The parameter '%s' has an invalid type '%s'. This is not permitted by the rules of Common IL." 3301,chkInvalidFunctionReturnType,"The function or method has an invalid return type '%s'. This is not permitted by the rules of Common IL." +3302,packageManagementRequiresVFive,"The 'package management' feature requires language version 5.0 or above" 3303,fromEndSlicingRequiresVFive,"The 'from the end slicing' feature requires language version 'preview'." 3304,poundiNotSupportedByRegisteredDependencyManagers,"#i is not supported by the registered PackageManagers" 3343,tcRequireMergeSourcesOrBindN,"The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '%s' method or appropriate 'MergeSources' and 'Bind' methods" @@ -1553,19 +1554,22 @@ optsAlwaysInline,"Always inline 'inline' functions" nativeResourceFormatError,"Stream does not begin with a null resource and is not in '.RES' format." nativeResourceHeaderMalformed,"Resource header beginning at offset %s is malformed." formatDashItem," - %s" +featurePackageManagement,"package management" featureFromEndSlicing,"from-end slicing" featureNullnessChecking,"nullness checking" +featureResumableStateMachines,"resumable state machines" featureRuntimeAsync,"runtime async" featureStringInterpolation,"string interpolation" featureWitnessPassing,"witness passing for trait constraints in F# quotations" featureAdditionalImplicitConversions,"additional type-directed conversions" featureReallyLongList,"list literals of any size" featureErrorOnDeprecatedRequireQualifiedAccess,"give error on deprecated access of construct with RequireQualifiedAccess attribute" +featureSelfTypeConstraints,"self type constraints" featureMatchNotAllowedForUnionCaseWithNoData,"Pattern match discard is not allowed for union case that takes no data." featureCSharpExtensionAttributeNotRequired,"Allow implicit Extension attribute on declaring types, modules" featureErrorForNonVirtualMembersOverrides,"Raises errors for non-virtual members overrides" featureWarningWhenCopyAndUpdateRecordChangesAllFields,"Raises warnings when an copy-and-update record expression changes all fields of a record." -featureWarningWhenMultipleRecdTypeChoice,"Raises warnings when multiple record type matches were found during name resolution because of overlapping field names." +featureNonInlineLiteralsAsPrintfFormat,"String values marked as literals and IL constants as printf format" 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." featurePreferExtensionMethodOverPlainProperty,"prefer extension method over plain property" @@ -1635,6 +1639,8 @@ forFormatInvalidForInterpolated4,"Interpolated strings used as type IFormattable 3501,tcResumableCodeArgMustHaveRightName,"Invalid resumable code. Resumable code parameter must have name beginning with '__expand'" 3501,tcResumableCodeArgMustHaveRightKind,"Invalid resumable code. A resumable code parameter must be of delegate or function type" 3501,tcResumableCodeContainsLetRec,"Invalid resumable code. A 'let rec' occurred in the resumable code specification" +3510,tcResumableCodeNotSupported,"Using resumable code or resumable state machines requires /langversion:preview" +3510,tcNoEagerConstraintApplicationAttribute,"Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later" 3511,reprStateMachineNotCompilable,"This state machine is not statically compilable. %s. An alternative dynamic implementation will be used, which may be slower. Consider adjusting your code to ensure this state machine is statically compilable, or else suppress this warning." 3512,reprStateMachineNotCompilableNoAlternative,"This state machine is not statically compilable and no alternative is available. %s. Use an 'if __useResumableCode then else ' to give an alternative." 3513,tcResumableCodeInvocation,"Resumable code invocation. Suppress this warning if you are defining new low-level resumable code in terms of existing resumable code." diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index de94bed966e..bc7c29b6c4b 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -16,7 +16,9 @@ module internal FSharp.Compiler.Features [] type LanguageFeature = + | PackageManagement | FromEndSlicing + | ResumableStateMachines | RuntimeAsync | WitnessPassing | AdditionalTypeDirectedConversions @@ -27,11 +29,12 @@ type LanguageFeature = | AttributesToRightOfModuleKeyword | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess + | SelfTypeConstraints | MatchNotAllowedForUnionCaseWithNoData | CSharpExtensionAttributeNotRequired | ErrorForNonVirtualMembersOverrides | WarningWhenCopyAndUpdateRecordChangesAllFields - | WarningWhenMultipleRecdTypeChoice + | NonInlineLiteralsAsPrintfFormat | ConstraintIntersectionOnFlexibleTypes | WarningWhenTailRecAttributeButNonTailRecUsage | UnmanagedConstraintCsharpInterop @@ -120,24 +123,27 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) dict [ // F# 5.0 + LanguageFeature.PackageManagement, languageVersion50 LanguageFeature.WitnessPassing, languageVersion50 LanguageFeature.StringInterpolation, languageVersion50 // F# 6.0 LanguageFeature.AdditionalTypeDirectedConversions, languageVersion60 LanguageFeature.ExpandedMeasurables, languageVersion60 + LanguageFeature.ResumableStateMachines, languageVersion60 LanguageFeature.AttributesToRightOfModuleKeyword, languageVersion60 // F# 7.0 LanguageFeature.ReallyLongLists, languageVersion70 LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess, languageVersion70 + LanguageFeature.SelfTypeConstraints, languageVersion70 // F# 8.0 LanguageFeature.MatchNotAllowedForUnionCaseWithNoData, languageVersion80 LanguageFeature.CSharpExtensionAttributeNotRequired, languageVersion80 LanguageFeature.ErrorForNonVirtualMembersOverrides, languageVersion80 LanguageFeature.WarningWhenCopyAndUpdateRecordChangesAllFields, languageVersion80 - LanguageFeature.WarningWhenMultipleRecdTypeChoice, languageVersion80 + LanguageFeature.NonInlineLiteralsAsPrintfFormat, languageVersion80 LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage, languageVersion80 LanguageFeature.ConstraintIntersectionOnFlexibleTypes, languageVersion80 @@ -290,8 +296,10 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) /// Get a string name for the given feature. static member GetFeatureString feature = match feature with + | LanguageFeature.PackageManagement -> FSComp.SR.featurePackageManagement () | LanguageFeature.FromEndSlicing -> FSComp.SR.featureFromEndSlicing () | LanguageFeature.NullnessChecking -> FSComp.SR.featureNullnessChecking () + | LanguageFeature.ResumableStateMachines -> FSComp.SR.featureResumableStateMachines () | LanguageFeature.RuntimeAsync -> FSComp.SR.featureRuntimeAsync () | LanguageFeature.WitnessPassing -> FSComp.SR.featureWitnessPassing () | LanguageFeature.AdditionalTypeDirectedConversions -> FSComp.SR.featureAdditionalImplicitConversions () @@ -301,12 +309,13 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) | LanguageFeature.AttributesToRightOfModuleKeyword -> FSComp.SR.featureAttributesToRightOfModuleKeyword () | LanguageFeature.ReallyLongLists -> FSComp.SR.featureReallyLongList () | LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess -> FSComp.SR.featureErrorOnDeprecatedRequireQualifiedAccess () + | LanguageFeature.SelfTypeConstraints -> FSComp.SR.featureSelfTypeConstraints () | LanguageFeature.MatchNotAllowedForUnionCaseWithNoData -> FSComp.SR.featureMatchNotAllowedForUnionCaseWithNoData () | LanguageFeature.CSharpExtensionAttributeNotRequired -> FSComp.SR.featureCSharpExtensionAttributeNotRequired () | LanguageFeature.ErrorForNonVirtualMembersOverrides -> FSComp.SR.featureErrorForNonVirtualMembersOverrides () | LanguageFeature.WarningWhenCopyAndUpdateRecordChangesAllFields -> FSComp.SR.featureWarningWhenCopyAndUpdateRecordChangesAllFields () - | LanguageFeature.WarningWhenMultipleRecdTypeChoice -> FSComp.SR.featureWarningWhenMultipleRecdTypeChoice () + | LanguageFeature.NonInlineLiteralsAsPrintfFormat -> FSComp.SR.featureNonInlineLiteralsAsPrintfFormat () | LanguageFeature.ConstraintIntersectionOnFlexibleTypes -> FSComp.SR.featureConstraintIntersectionOnFlexibleTypes () | LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage -> FSComp.SR.featureChkNotTailRecursive () | LanguageFeature.UnmanagedConstraintCsharpInterop -> FSComp.SR.featureUnmanagedConstraintCsharpInterop () diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 44963e9f437..ae1b8e79d11 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -6,7 +6,9 @@ module internal FSharp.Compiler.Features /// LanguageFeature enumeration [] type LanguageFeature = + | PackageManagement | FromEndSlicing + | ResumableStateMachines | RuntimeAsync | WitnessPassing | AdditionalTypeDirectedConversions @@ -17,11 +19,12 @@ type LanguageFeature = | AttributesToRightOfModuleKeyword | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess + | SelfTypeConstraints | MatchNotAllowedForUnionCaseWithNoData | CSharpExtensionAttributeNotRequired | ErrorForNonVirtualMembersOverrides | WarningWhenCopyAndUpdateRecordChangesAllFields - | WarningWhenMultipleRecdTypeChoice + | NonInlineLiteralsAsPrintfFormat | ConstraintIntersectionOnFlexibleTypes | WarningWhenTailRecAttributeButNonTailRecUsage | UnmanagedConstraintCsharpInterop diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index fd71f7477b2..05e239c927c 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -597,11 +597,6 @@ Vyvolá upozornění, když výraz záznamu kopírování a aktualizace změní všechna pole záznamu. - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - Vyvolá upozornění, pokud bylo během překladu názvů nalezeno více shod typu záznamu z důvodu překrývajících se názvů polí. - - witness passing for trait constraints in F# quotations Předávání kopie clusteru pro omezení vlastností v uvozovkách v jazyce F# diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 94dd5a853d4..e5d6bf760ac 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -597,11 +597,6 @@ Löst Warnungen aus, wenn ein Ausdruck zum Kopieren und Aktualisieren von Datensätzen alle Felder eines Datensatzes ändert. - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - Löst Warnungen aus, wenn bei der Namensauflösung aufgrund überlappender Feldnamen mehrere Datensatztypüberstimmungen gefunden wurden. - - witness passing for trait constraints in F# quotations Zeugenübergabe für Merkmalseinschränkungen in F#-Zitaten diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index aa957d50c55..868e8c38d69 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -597,11 +597,6 @@ Emite advertencias cuando una expresión de copiar y actualizar registros cambia todos los campos de un registro. - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - Genera advertencias cuando se encontraron varias coincidencias de tipo de registro durante la resolución de nombres debido a nombres de campo superpuestos. - - witness passing for trait constraints in F# quotations Paso de testigo para las restricciones de rasgos en las expresiones de código delimitadas de F# diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 7898b748239..645f7226f5b 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -597,11 +597,6 @@ Génère des avertissements lorsqu'une expression d'enregistrement de copie et de mise à jour modifie tous les champs d'un enregistrement. - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - Déclenche des avertissements lorsque plusieurs correspondances de types d'enregistrement ont été trouvées lors de la résolution de nom en raison de noms de champs qui se chevauchent. - - witness passing for trait constraints in F# quotations Passage de témoin pour les contraintes de trait dans les quotations F# diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 93f633805e9..de021cdfb4b 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -597,11 +597,6 @@ Genera avvisi quando un'espressione di record di copia e aggiornamento modifica tutti i campi di un record. - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - Genera avvisi quando sono state trovate più corrispondenze del tipo di record durante la risoluzione dei nomi a causa di nomi di campi sovrapposti. - - witness passing for trait constraints in F# quotations Passaggio del testimone per vincoli di tratto in quotation F# diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 2407906320e..a11b00fa074 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -597,11 +597,6 @@ copy-and-update レコード式によってレコードのすべてのフィールドが変更されたときに警告を表示します。 - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - フィールド名が重複しているため、名前解決中に複数のレコードの種類の一致が見つかった場合に警告を生成します。 - - witness passing for trait constraints in F# quotations F# 引用での特性制約に対する監視の引き渡し diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index b35a65b4344..1ec253be515 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -597,11 +597,6 @@ 레코드 복사 및 업데이트 식이 레코드의 모든 필드를 변경할 때 경고를 발생합니다. - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - 필드 이름이 겹치므로 이름 확인 중에 레코드 유형 일치가 여러 개 발견되면 경고가 발생합니다. - - witness passing for trait constraints in F# quotations F# 인용의 특성 제약 조건에 대한 감시 전달 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index e7f20c76905..562d5158a75 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -597,11 +597,6 @@ Zgłasza ostrzeżenia, gdy wyrażenie rekordu kopiowania i aktualizacji zmieni wszystkie pola rekordu. - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - Zgłasza ostrzeżenia, gdy znaleziono wiele dopasowań typów rekordów podczas rozpoznawania nazw z powodu nakładających się nazw pól. - - witness passing for trait constraints in F# quotations monitor, który przekazuje ograniczenia cech języka F# diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 02972428b5b..36569ff89f3 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -597,11 +597,6 @@ Gera avisos quando uma expressão de registro de cópia e atualização altera todos os campos de um registro. - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - Gera avisos quando várias correspondências de tipo de registro foram encontradas durante a resolução de nomes devido à sobreposição de nomes de campo. - - witness passing for trait constraints in F# quotations Passagem de testemunha para restrições de característica nas citações do F# diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 161b7677cb7..4427b9a466a 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -597,11 +597,6 @@ Создает предупреждения, когда выражение копирования и обновления записи изменяет все поля записи. - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - Выдает предупреждения, когда при разрешении имен обнаружено несколько совпадений типов записи из-за перекрывающихся имен полей. - - witness passing for trait constraints in F# quotations Передача свидетеля для ограничений признаков в цитированиях F# diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 8ff397ae9dd..f92630e546d 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -597,11 +597,6 @@ Bir kopyalama ve güncelleştirme kayıt ifadesi bir kaydın tüm alanlarını değiştirdiğinde uyarı oluşturur. - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - Çakışan alan adları nedeniyle, ad çözümlemesi sırasında birden çok kayıt türü eşleşmesi olduğunda uyarı verir. - - witness passing for trait constraints in F# quotations F# alıntılarındaki nitelik kısıtlamaları için tanık geçirme diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 85319784922..143ba03163c 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -597,11 +597,6 @@ 复制和更新记录表达式更改记录的所有字段时引发警告。 - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - 在名称解析期间由于字段名称重叠而找到多个记录类型匹配项时引发警告。 - - witness passing for trait constraints in F# quotations F# 引号中特征约束的见证传递 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 0c3906e97d1..ba1b00b0850 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -597,11 +597,6 @@ 當複製和更新記錄運算式變更記錄的所有欄位時引發警告。 - - Raises warnings when multiple record type matches were found during name resolution because of overlapping field names. - 在名稱解析期間由於欄位名稱重疊而找到多個記錄類型相符項目時引發警告。 - - witness passing for trait constraints in F# quotations 見證 F# 引號中特徵條件約束的傳遞