Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Compiler/Checking/Expressions/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
13 changes: 3 additions & 10 deletions src/Compiler/Driver/CompilerDiagnostics.fs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ type Exception with
| LetRecEvaluatedOutOfOrder(_, _, _, m)
| DiagnosticWithText(_, _, m)
| DiagnosticWithSuggestions(_, _, m, _, _)
| DiagnosticEnabledWithLanguageFeature(_, _, m, _)
| SyntaxError(_, m)
| InternalError(_, m)
| InternalException(_, _, m)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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...."
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
6 changes: 0 additions & 6 deletions src/Compiler/Facilities/DiagnosticsLogger.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 ([<InlineIfLambda>] f) =
try
f ()
Expand Down
10 changes: 0 additions & 10 deletions src/Compiler/Facilities/DiagnosticsLogger.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ type LanguageFeature =
| UnionIsPropertiesVisible
| AttributesToRightOfModuleKeyword
| CSharpExtensionAttributeNotRequired
| WarningWhenCopyAndUpdateRecordChangesAllFields
| UnmanagedConstraintCsharpInterop
| ReuseSameFieldsInStructUnions
| PreferExtensionMethodOverPlainProperty
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ()
Expand Down
1 change: 0 additions & 1 deletion src/Compiler/Facilities/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ type LanguageFeature =
| UnionIsPropertiesVisible
| AttributesToRightOfModuleKeyword
| CSharpExtensionAttributeNotRequired
| WarningWhenCopyAndUpdateRecordChangesAllFields
| UnmanagedConstraintCsharpInterop
| ReuseSameFieldsInStructUnions
/// RFC-1137
Expand Down
5 changes: 0 additions & 5 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.

5 changes: 0 additions & 5 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.

5 changes: 0 additions & 5 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.

5 changes: 0 additions & 5 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.

5 changes: 0 additions & 5 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.

5 changes: 0 additions & 5 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.

5 changes: 0 additions & 5 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.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.pl.xlf

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

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.pt-BR.xlf

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

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.ru.xlf

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

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.tr.xlf

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

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.zh-Hans.xlf

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

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.zh-Hant.xlf

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

Loading