Skip to content

Commit c2b38d7

Browse files
T-GroCopilotCopilot
authored
Remove always-on UseBindingValueDiscard language feature flag (#20162) (#20218)
Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 089835d commit c2b38d7

17 files changed

Lines changed: 3 additions & 75 deletions

‎src/Compiler/Checking/Expressions/CheckExpressions.fs‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12218,11 +12218,9 @@ and TcLetBinding (cenv: cenv) isUse env containerInfo declKind tpenv (synBinds,
1221812218
let tmp, _ = mkCompGenLocal m "patternInput" (generalizedTypars +-> tauTy)
1221912219

1222012220
if isUse then
12221-
let isDiscarded = match checkedPat with TPat_wild _ -> true | _ -> false
12222-
if not isDiscarded then
12223-
errorR(Error(FSComp.SR.tcInvalidUseBinding(), m))
12224-
else
12225-
checkLanguageFeatureAndRecover g.langVersion LanguageFeature.UseBindingValueDiscard checkedPat.Range
12221+
match checkedPat with
12222+
| TPat_wild _ -> ()
12223+
| _ -> errorR(Error(FSComp.SR.tcInvalidUseBinding(), m))
1222612224

1222712225
elif isFixed then
1222812226
errorR(Error(FSComp.SR.tcInvalidUseBinding(), m))

‎src/Compiler/FSComp.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,6 @@ featureOverloadsForCustomOperations,"overloads for custom operations"
12521252
featureExpandedMeasurables,"more types support units of measure"
12531253
featureIndexerNotationWithoutDot,"expr[idx] notation for indexing and slicing"
12541254
featureRefCellNotationInformationals,"informational messages related to reference cells"
1255-
featureDiscardUseValue,"discard pattern in use binding"
12561255
featureNonVariablePatternsToRightOfAsPatterns,"non-variable patterns to the right of 'as' patterns"
12571256
featureAttributesToRightOfModuleKeyword,"attributes to the right of the 'module' keyword"
12581257
featureBetterExceptionPrinting,"automatic generation of 'Message' property for 'exception' declarations"

‎src/Compiler/Facilities/LanguageFeatures.fs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ type LanguageFeature =
3939
| NullnessChecking
4040
| IndexerNotationWithoutDot
4141
| RefCellNotationInformationals
42-
| UseBindingValueDiscard
4342
| UnionIsPropertiesVisible
4443
| NonVariablePatternsToRightOfAsPatterns
4544
| AttributesToRightOfModuleKeyword
@@ -178,7 +177,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
178177
LanguageFeature.ResumableStateMachines, languageVersion60
179178
LanguageFeature.IndexerNotationWithoutDot, languageVersion60
180179
LanguageFeature.RefCellNotationInformationals, languageVersion60
181-
LanguageFeature.UseBindingValueDiscard, languageVersion60
182180
LanguageFeature.NonVariablePatternsToRightOfAsPatterns, languageVersion60
183181
LanguageFeature.AttributesToRightOfModuleKeyword, languageVersion60
184182
LanguageFeature.DelegateTypeNameResolutionFix, languageVersion60
@@ -390,7 +388,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
390388
| LanguageFeature.ExpandedMeasurables -> FSComp.SR.featureExpandedMeasurables ()
391389
| LanguageFeature.IndexerNotationWithoutDot -> FSComp.SR.featureIndexerNotationWithoutDot ()
392390
| LanguageFeature.RefCellNotationInformationals -> FSComp.SR.featureRefCellNotationInformationals ()
393-
| LanguageFeature.UseBindingValueDiscard -> FSComp.SR.featureDiscardUseValue ()
394391
| LanguageFeature.UnionIsPropertiesVisible -> FSComp.SR.featureUnionIsPropertiesVisible ()
395392
| LanguageFeature.NonVariablePatternsToRightOfAsPatterns -> FSComp.SR.featureNonVariablePatternsToRightOfAsPatterns ()
396393
| LanguageFeature.AttributesToRightOfModuleKeyword -> FSComp.SR.featureAttributesToRightOfModuleKeyword ()

‎src/Compiler/Facilities/LanguageFeatures.fsi‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ type LanguageFeature =
2929
| NullnessChecking
3030
| IndexerNotationWithoutDot
3131
| RefCellNotationInformationals
32-
| UseBindingValueDiscard
3332
| UnionIsPropertiesVisible
3433
| NonVariablePatternsToRightOfAsPatterns
3534
| AttributesToRightOfModuleKeyword

‎src/Compiler/xlf/FSComp.txt.cs.xlf‎

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Compiler/xlf/FSComp.txt.de.xlf‎

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Compiler/xlf/FSComp.txt.es.xlf‎

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Compiler/xlf/FSComp.txt.fr.xlf‎

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Compiler/xlf/FSComp.txt.it.xlf‎

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Compiler/xlf/FSComp.txt.ja.xlf‎

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)