diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 405e0300c85..ceb7a4da0aa 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -7203,8 +7203,7 @@ and TcRecordConstruction (cenv: cenv) (overallTy: TType) isObjExpr env tpenv wit // `TransformAstForNestedUpdates` creates record constructions with synthetic ranges. // Don't emit the warning for nested field updates, because it does not really make sense. if oldFldsList.IsEmpty && not m.IsSynthetic then - let enabledByLangFeature = g.langVersion.SupportsFeature LanguageFeature.WarningWhenCopyAndUpdateRecordChangesAllFields - warning(ErrorEnabledWithLanguageFeature(FSComp.SR.tcCopyAndUpdateRecordChangesAllFields(richTextOfQualifiedTyconRef tcref), m, enabledByLangFeature)) + warning(Error(FSComp.SR.tcCopyAndUpdateRecordChangesAllFields(richTextOfQualifiedTyconRef tcref), m)) if not (Zset.subset ns1 ns2) then error (Error(FSComp.SR.tcExtraneousFieldsGivenValues(), m)) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 3b46c9b64c4..17177e38c37 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -119,7 +119,6 @@ type Exception with | LetRecEvaluatedOutOfOrder(_, _, _, m) | DiagnosticWithText(_, _, m) | DiagnosticWithSuggestions(_, _, m, _, _) - | DiagnosticEnabledWithLanguageFeature(_, _, m, _) | SyntaxError(_, m) | InternalError(_, m) | InternalException(_, _, m) @@ -339,7 +338,6 @@ type Exception with | WrappedError(e, _) -> e.DiagnosticNumber | DiagnosticWithText(n, _, _) -> n | DiagnosticWithSuggestions(n, _, _, _, _) -> n - | DiagnosticEnabledWithLanguageFeature(n, _, _, _) -> n | IllegalFileNameChar(fileName, invalidChar) -> fst (FSComp.SR.buildUnexpectedFileNameCharacter (fileName, string invalidChar)) #if !NO_TYPEPROVIDERS | :? TypeProviderError as e -> e.Number @@ -368,7 +366,6 @@ type PhasedDiagnostic with | DefensiveCopyWarning _ -> 5 | DiagnosticWithText(n, _, _) - | DiagnosticEnabledWithLanguageFeature(n, _, _, _) | DiagnosticWithSuggestions(n, _, _, _, _) -> // 1178, tcNoComparisonNeeded1, "The struct, record or union type '%s' is not structurally comparable because the type parameter %s does not satisfy the 'comparison' constraint..." // 1178, tcNoComparisonNeeded2, "The struct, record or union type '%s' is not structurally comparable because the type '%s' does not satisfy the 'comparison' constraint...." @@ -408,11 +405,8 @@ type PhasedDiagnostic with | 3906 -> false // tcRecordExplicitFieldShadowsSpreadField - off by default | 3907 -> false // tcRecordExprSpreadFieldShadowsSpreadField - off by default | _ -> - match x.Exception with - | DiagnosticEnabledWithLanguageFeature(_, _, _, enabled) -> enabled - | _ -> - (severity = FSharpDiagnosticSeverity.Info && level > 0) - || (severity = FSharpDiagnosticSeverity.Warning && level >= x.WarningLevel) + (severity = FSharpDiagnosticSeverity.Info && level > 0) + || (severity = FSharpDiagnosticSeverity.Warning && level >= x.WarningLevel) member x.AdjustSeverity(options) = let severity = x.Severity @@ -1866,8 +1860,7 @@ type Exception with os.Append(NonUniqueInferredAbstractSlot4E().Format) - | DiagnosticWithText(_, s, _) - | DiagnosticEnabledWithLanguageFeature(_, s, _, _) -> os.Append s + | DiagnosticWithText(_, s, _) -> os.Append s | DiagnosticWithSuggestions(_, s, _, idText, suggestionF) -> os.Append s diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index b02cde786b7..33ffb102efc 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1555,7 +1555,6 @@ featureNullnessChecking,"nullness checking" featureRuntimeAsync,"runtime async" featureWitnessPassing,"witness passing for trait constraints in F# quotations" featureCSharpExtensionAttributeNotRequired,"Allow implicit Extension attribute on declaring types, modules" -featureWarningWhenCopyAndUpdateRecordChangesAllFields,"Raises warnings when an copy-and-update record expression changes all fields of a record." 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/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index a296240a1c0..31b80a6437d 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -129,9 +129,6 @@ exception DiagnosticWithSuggestions of number: int * message: RichText * range: | DiagnosticWithSuggestions(_, msg, _, _, _) -> msg.Text | _ -> "impossible" -/// A diagnostic that is raised when enabled manually, or by default with a language feature -exception DiagnosticEnabledWithLanguageFeature of number: int * message: RichText * range: range * enabledByLangFeature: bool - type ObsoleteDiagnosticInfo = | ObsoleteDiagnosticInfo of isError: bool * diagnosticId: string option * message: string option * urlFormat: string option @@ -155,9 +152,6 @@ let Error ((n, text): int * RichText, m) = DiagnosticWithText(n, text, m) let ErrorWithSuggestions ((n, message), m, id, suggestions) = DiagnosticWithSuggestions(n, message, m, id, suggestions) -let ErrorEnabledWithLanguageFeature ((n, message), m, enabledByLangFeature) = - DiagnosticEnabledWithLanguageFeature(n, message, m, enabledByLangFeature) - let inline protectAssemblyExploration dflt ([] f) = try f () diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fsi b/src/Compiler/Facilities/DiagnosticsLogger.fsi index 0822cd15b0a..502338bb2cd 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fsi +++ b/src/Compiler/Facilities/DiagnosticsLogger.fsi @@ -48,13 +48,6 @@ val StopProcessing<'T> : exn /// Represents a diagnostic exception whose text comes via SR.* exception DiagnosticWithText of number: int * message: RichText * range: range -/// A diagnostic that is raised when enabled manually, or by default with a language feature -exception DiagnosticEnabledWithLanguageFeature of - number: int * - message: RichText * - range: range * - enabledByLangFeature: bool - /// Creates a diagnostic exception whose text comes via SR.* val Error: (int * RichText) * range -> exn @@ -104,9 +97,6 @@ exception ObsoleteDiagnostic of /// Creates a DiagnosticWithSuggestions whose text comes via SR.* val ErrorWithSuggestions: (int * RichText) * range * string * Suggestions -> exn -/// Creates a DiagnosticEnabledWithLanguageFeature whose text comes via SR.* -val ErrorEnabledWithLanguageFeature: (int * RichText) * range * bool -> exn - val inline protectAssemblyExploration: dflt: 'T -> f: (unit -> 'T) -> 'T val inline protectAssemblyExplorationF: dflt: (string * string -> 'T) -> f: (unit -> 'T) -> 'T diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index bbf484350d7..e9037ce7d18 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -23,7 +23,6 @@ type LanguageFeature = | UnionIsPropertiesVisible | AttributesToRightOfModuleKeyword | CSharpExtensionAttributeNotRequired - | WarningWhenCopyAndUpdateRecordChangesAllFields | UnmanagedConstraintCsharpInterop | ReuseSameFieldsInStructUnions | PreferExtensionMethodOverPlainProperty @@ -117,7 +116,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) // F# 8.0 LanguageFeature.CSharpExtensionAttributeNotRequired, languageVersion80 - LanguageFeature.WarningWhenCopyAndUpdateRecordChangesAllFields, languageVersion80 // F# 9.0 LanguageFeature.NullnessChecking, languageVersion90 @@ -275,8 +273,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) | LanguageFeature.UnionIsPropertiesVisible -> FSComp.SR.featureUnionIsPropertiesVisible () | LanguageFeature.AttributesToRightOfModuleKeyword -> FSComp.SR.featureAttributesToRightOfModuleKeyword () | LanguageFeature.CSharpExtensionAttributeNotRequired -> FSComp.SR.featureCSharpExtensionAttributeNotRequired () - | LanguageFeature.WarningWhenCopyAndUpdateRecordChangesAllFields -> - FSComp.SR.featureWarningWhenCopyAndUpdateRecordChangesAllFields () | LanguageFeature.UnmanagedConstraintCsharpInterop -> FSComp.SR.featureUnmanagedConstraintCsharpInterop () | LanguageFeature.ReuseSameFieldsInStructUnions -> FSComp.SR.featureReuseSameFieldsInStructUnions () | LanguageFeature.PreferExtensionMethodOverPlainProperty -> FSComp.SR.featurePreferExtensionMethodOverPlainProperty () diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index df4d038bcb4..5eeb7027916 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -13,7 +13,6 @@ type LanguageFeature = | UnionIsPropertiesVisible | AttributesToRightOfModuleKeyword | CSharpExtensionAttributeNotRequired - | WarningWhenCopyAndUpdateRecordChangesAllFields | UnmanagedConstraintCsharpInterop | ReuseSameFieldsInStructUnions /// RFC-1137 diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index c5a9c4b2676..17f92b5d4cb 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -542,11 +542,6 @@ Metoda getter a setter indexované vlastnosti musí mít stejný typ. - - Raises warnings when an copy-and-update record expression changes all fields of a record. - Vyvolá upozornění, když výraz záznamu kopírování a aktualizace změní všechna pole záznamu. - - 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 867b411b201..7eedd0984a0 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -542,11 +542,6 @@ Getter und Setter für indizierte Eigenschaften müssen denselben Typ aufweisen. - - Raises warnings when an copy-and-update record expression changes all fields of a record. - Löst Warnungen aus, wenn ein Ausdruck zum Kopieren und Aktualisieren von Datensätzen alle Felder eines Datensatzes ändert. - - 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 27e705b2ae7..ac849af6825 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -542,11 +542,6 @@ El captador y el establecedor de propiedades indexadas deben tener el mismo tipo. - - Raises warnings when an copy-and-update record expression changes all fields of a record. - Emite advertencias cuando una expresión de copiar y actualizar registros cambia todos los campos de un registro. - - 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 92a65bfeafe..cc506b28fd9 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -542,11 +542,6 @@ Les propriétés indexées getter et setter doivent avoir le même type - - Raises warnings when an copy-and-update record expression changes all fields of a record. - Génère des avertissements lorsqu'une expression d'enregistrement de copie et de mise à jour modifie tous les champs d'un enregistrement. - - 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 852a48f10dc..321520d3669 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -542,11 +542,6 @@ Il getter e il setter delle proprietà indicizzate devono avere lo stesso tipo - - Raises warnings when an copy-and-update record expression changes all fields of a record. - Genera avvisi quando un'espressione di record di copia e aggiornamento modifica tutti i campi di un record. - - 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 06a91ab7e68..6aa0351ad1f 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -542,11 +542,6 @@ インデックス付きプロパティのゲッターとセッターの型は同じである必要があります - - Raises warnings when an copy-and-update record expression changes all fields of a record. - copy-and-update レコード式によってレコードのすべてのフィールドが変更されたときに警告を表示します。 - - 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 2e5b5a8e106..2aebe933c4d 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -542,11 +542,6 @@ 인덱싱된 속성 getter와 setter의 형식이 같아야 합니다. - - Raises warnings when an copy-and-update record expression changes all fields of a record. - 레코드 복사 및 업데이트 식이 레코드의 모든 필드를 변경할 때 경고를 발생합니다. - - 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 c1487a69e3b..add0b4ae113 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -542,11 +542,6 @@ Metoda pobierająca i metoda ustawiająca właściwości indeksowanych muszą mieć taki sam typ. - - Raises warnings when an copy-and-update record expression changes all fields of a record. - Zgłasza ostrzeżenia, gdy wyrażenie rekordu kopiowania i aktualizacji zmieni wszystkie pola rekordu. - - 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 645ef2ae3a4..4bcdeb9c31b 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -542,11 +542,6 @@ As propriedades indexadas getter e setter devem ter o mesmo tipo - - Raises warnings when an copy-and-update record expression changes all fields of a record. - Gera avisos quando uma expressão de registro de cópia e atualização altera todos os campos de um registro. - - 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 306f9225124..e430cf894cd 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -542,11 +542,6 @@ Методы получения и установки индексированных свойств должны иметь один и тот же тип. - - Raises warnings when an copy-and-update record expression changes all fields of a record. - Создает предупреждения, когда выражение копирования и обновления записи изменяет все поля записи. - - 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 c8b6cd689a1..496cd498ef5 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -542,11 +542,6 @@ Dizini oluşturulmuş özelliklerin alıcısı ve ayarlayıcısı aynı türde olmalıdır - - Raises warnings when an copy-and-update record expression changes all fields of a record. - Bir kopyalama ve güncelleştirme kayıt ifadesi bir kaydın tüm alanlarını değiştirdiğinde uyarı oluşturur. - - 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 ca45f8f398b..2ed37ab260f 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -542,11 +542,6 @@ 索引属性 getter 和 setter 必须具有相同的类型 - - Raises warnings when an copy-and-update record expression changes all fields of a record. - 复制和更新记录表达式更改记录的所有字段时引发警告。 - - 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 0b261fc5869..221b0cecdcc 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -542,11 +542,6 @@ 索引屬性 getter 和 setter 必須具有相同的類型 - - Raises warnings when an copy-and-update record expression changes all fields of a record. - 當複製和更新記錄運算式變更記錄的所有欄位時引發警告。 - - witness passing for trait constraints in F# quotations 見證 F# 引號中特徵條件約束的傳遞