Skip to content

Commit 57fca23

Browse files
T-GroCopilotCopilot
authored
Flatten always-on DiagnosticForObjInference language feature (#20178) (#20312)
Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8e00165 commit 57fca23

17 files changed

Lines changed: 4 additions & 77 deletions

‎src/Compiler/Checking/TypeRelations.fs‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,10 @@ let ChooseTyparSolutionAndRange (g: TcGlobals) amap (tp:Typar) =
228228
(maxTy, isRefined), m
229229
)
230230

231-
if g.langVersion.SupportsFeature LanguageFeature.DiagnosticForObjInference then
232-
match tp.Kind with
233-
| TyparKind.Type ->
234-
if not isRefined then
235-
informationalWarning(Error(FSComp.SR.typrelNeverRefinedAwayFromTop(), m))
236-
| TyparKind.Measure -> ()
231+
match tp.Kind with
232+
| TyparKind.Type when not isRefined ->
233+
informationalWarning(Error(FSComp.SR.typrelNeverRefinedAwayFromTop(), m))
234+
| _ -> ()
237235

238236
maxTy, m
239237

‎src/Compiler/FSComp.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,6 @@ featureEscapeBracesInFormattableString,"Escapes curly braces before calling Form
17331733
3563,lexInvalidIdentifier,"This is not a valid identifier"
17341734
3564,parsMissingUnionCaseName,"Missing union case name"
17351735
3565,parsExpectingType,"Expecting type"
1736-
featureInformationalObjInferenceDiagnostic,"Diagnostic 3559 (warn when obj inferred) at informational level, off by default"
17371736
featureStaticLetInRecordsDusEmptyTypes,"Allow static let bindings in union, record, struct, non-incremental-class types"
17381737
3566,tcMultipleRecdTypeChoice,"Multiple type matches were found:\n%s\nThe type '%s' was used. Due to the overlapping field names\n%s\nconsider using type annotations or change the order of open statements."
17391738
3567,parsMissingMemberBody,"Expecting member body"

‎src/Compiler/Facilities/LanguageFeatures.fs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ type LanguageFeature =
6262
| ExtendedStringInterpolation
6363
| WarningWhenMultipleRecdTypeChoice
6464
| ImprovedImpliedArgumentNames
65-
| DiagnosticForObjInference
6665
| ConstraintIntersectionOnFlexibleTypes
6766
| StaticLetInRecordsDusEmptyTypes
6867
| WarningWhenTailRecAttributeButNonTailRecUsage
@@ -197,7 +196,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
197196
LanguageFeature.ExtendedStringInterpolation, languageVersion80
198197
LanguageFeature.WarningWhenMultipleRecdTypeChoice, languageVersion80
199198
LanguageFeature.ImprovedImpliedArgumentNames, languageVersion80
200-
LanguageFeature.DiagnosticForObjInference, languageVersion80
201199
LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage, languageVersion80
202200
LanguageFeature.StaticLetInRecordsDusEmptyTypes, languageVersion80
203201
LanguageFeature.ConstraintIntersectionOnFlexibleTypes, languageVersion80
@@ -403,8 +401,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
403401
| LanguageFeature.ExtendedStringInterpolation -> FSComp.SR.featureExtendedStringInterpolation ()
404402
| LanguageFeature.WarningWhenMultipleRecdTypeChoice -> FSComp.SR.featureWarningWhenMultipleRecdTypeChoice ()
405403
| LanguageFeature.ImprovedImpliedArgumentNames -> FSComp.SR.featureImprovedImpliedArgumentNames ()
406-
| LanguageFeature.DiagnosticForObjInference -> FSComp.SR.featureInformationalObjInferenceDiagnostic ()
407-
408404
| LanguageFeature.StaticLetInRecordsDusEmptyTypes -> FSComp.SR.featureStaticLetInRecordsDusEmptyTypes ()
409405
| LanguageFeature.ConstraintIntersectionOnFlexibleTypes -> FSComp.SR.featureConstraintIntersectionOnFlexibleTypes ()
410406
| LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage -> FSComp.SR.featureChkNotTailRecursive ()

‎src/Compiler/Facilities/LanguageFeatures.fsi‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ type LanguageFeature =
5252
| ExtendedStringInterpolation
5353
| WarningWhenMultipleRecdTypeChoice
5454
| ImprovedImpliedArgumentNames
55-
| DiagnosticForObjInference
5655
| ConstraintIntersectionOnFlexibleTypes
5756
| StaticLetInRecordsDusEmptyTypes
5857
| WarningWhenTailRecAttributeButNonTailRecUsage

‎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)