Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Remove obsolete qualified access language feature flag
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Loading branch information
Copilot and Copilot committed Oct 6, 2026
commit 8a9fd9b9db15e76a2a21ece876dcf8373b50275e
6 changes: 1 addition & 5 deletions src/Compiler/Checking/CheckPatterns.fs
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,7 @@ and ApplyUnionCaseOrExn m (cenv: cenv) env overallTy item =

| Item.UnionCase(ucinfo, showDeprecated) ->
if showDeprecated then
let diagnostic = Deprecated(FSComp.SR.nrUnionTypeNeedsQualifiedAccess(RichText.mkUnionCase ucinfo.DisplayName, richTextOfEntity ucinfo.Tycon) |> snd, m)
if g.langVersion.SupportsFeature(LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess) then
errorR(diagnostic)
else
warning(diagnostic)
errorR (Deprecated(FSComp.SR.nrUnionTypeNeedsQualifiedAccess(RichText.mkUnionCase ucinfo.DisplayName, richTextOfEntity ucinfo.Tycon) |> snd, m))

let ucref = ucinfo.UnionCaseRef
CheckUnionCaseAttributes g ucref m |> CommitOperationResult
Expand Down
12 changes: 2 additions & 10 deletions src/Compiler/Checking/Expressions/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2012,11 +2012,7 @@ let BuildFieldMap (cenv: cenv) env isPartial ty (flds: (Ident * ExplicitOrSpread
CheckFSharpAttributes g fref2.PropertyAttribs ident.idRange |> CommitOperationResult

if showDeprecated then
let diagnostic = Deprecated(FSComp.SR.nrRecordTypeNeedsQualifiedAccess(RichText.mkRecordField fref2.FieldName, richTextOfEntity fref2.Tycon) |> snd, m)
if g.langVersion.SupportsFeature(LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess) then
errorR(diagnostic)
else
warning(diagnostic)
errorR (Deprecated(FSComp.SR.nrRecordTypeNeedsQualifiedAccess(RichText.mkRecordField fref2.FieldName, richTextOfEntity fref2.Tycon) |> snd, m))

if not (tyconRefEq g tcref fref2.TyconRef) then
let _, frefSet1, _ = List.head fldResolutions
Expand All @@ -2042,11 +2038,7 @@ let ApplyUnionCaseOrExn (makerForUnionCase, makerForExnTag) m mItemIdent (cenv:

| Item.UnionCase(ucinfo, showDeprecated) ->
if showDeprecated then
let diagnostic = Deprecated(FSComp.SR.nrUnionTypeNeedsQualifiedAccess(RichText.mkUnionCase ucinfo.DisplayName, richTextOfEntity ucinfo.Tycon) |> snd, mItemIdent)
if g.langVersion.SupportsFeature(LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess) then
errorR(diagnostic)
else
warning(diagnostic)
errorR (Deprecated(FSComp.SR.nrUnionTypeNeedsQualifiedAccess(RichText.mkUnionCase ucinfo.DisplayName, richTextOfEntity ucinfo.Tycon) |> snd, mItemIdent))

let ucref = ucinfo.UnionCaseRef
CheckUnionCaseAttributes g ucref mItemIdent |> CommitOperationResult
Expand Down
8 changes: 7 additions & 1 deletion src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -1553,18 +1554,21 @@ 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."
featureNonInlineLiteralsAsPrintfFormat,"String values marked as literals and IL constants as printf format"
featureWarningWhenMultipleRecdTypeChoice,"Raises warnings when multiple record type matches were found during name resolution because of overlapping field names."
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."
Expand Down Expand Up @@ -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 <state-machine> else <alternative>' 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."
Expand Down
15 changes: 12 additions & 3 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ module internal FSharp.Compiler.Features

[<RequireQualifiedAccess>]
type LanguageFeature =
| PackageManagement
| FromEndSlicing
| ResumableStateMachines
| RuntimeAsync
| WitnessPassing
| AdditionalTypeDirectedConversions
Expand All @@ -26,11 +28,12 @@ type LanguageFeature =
| UnionIsPropertiesVisible
| AttributesToRightOfModuleKeyword
| ReallyLongLists
| ErrorOnDeprecatedRequireQualifiedAccess
| SelfTypeConstraints
| MatchNotAllowedForUnionCaseWithNoData
| CSharpExtensionAttributeNotRequired
| ErrorForNonVirtualMembersOverrides
| WarningWhenCopyAndUpdateRecordChangesAllFields
| NonInlineLiteralsAsPrintfFormat
| WarningWhenMultipleRecdTypeChoice
| ConstraintIntersectionOnFlexibleTypes
| WarningWhenTailRecAttributeButNonTailRecUsage
Expand Down Expand Up @@ -120,23 +123,26 @@ 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.NonInlineLiteralsAsPrintfFormat, languageVersion80
LanguageFeature.WarningWhenMultipleRecdTypeChoice, languageVersion80
LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage, languageVersion80
LanguageFeature.ConstraintIntersectionOnFlexibleTypes, languageVersion80
Expand Down Expand Up @@ -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 ()
Expand All @@ -300,12 +308,13 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
| LanguageFeature.UnionIsPropertiesVisible -> FSComp.SR.featureUnionIsPropertiesVisible ()
| 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.NonInlineLiteralsAsPrintfFormat -> FSComp.SR.featureNonInlineLiteralsAsPrintfFormat ()
| LanguageFeature.WarningWhenMultipleRecdTypeChoice -> FSComp.SR.featureWarningWhenMultipleRecdTypeChoice ()
| LanguageFeature.ConstraintIntersectionOnFlexibleTypes -> FSComp.SR.featureConstraintIntersectionOnFlexibleTypes ()
| LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage -> FSComp.SR.featureChkNotTailRecursive ()
Expand Down
5 changes: 4 additions & 1 deletion src/Compiler/Facilities/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ module internal FSharp.Compiler.Features
/// LanguageFeature enumeration
[<RequireQualifiedAccess>]
type LanguageFeature =
| PackageManagement
| FromEndSlicing
| ResumableStateMachines
| RuntimeAsync
| WitnessPassing
| AdditionalTypeDirectedConversions
Expand All @@ -16,11 +18,12 @@ type LanguageFeature =
| UnionIsPropertiesVisible
| AttributesToRightOfModuleKeyword
| ReallyLongLists
| ErrorOnDeprecatedRequireQualifiedAccess
| SelfTypeConstraints
| MatchNotAllowedForUnionCaseWithNoData
| CSharpExtensionAttributeNotRequired
| ErrorForNonVirtualMembersOverrides
| WarningWhenCopyAndUpdateRecordChangesAllFields
| NonInlineLiteralsAsPrintfFormat
| WarningWhenMultipleRecdTypeChoice
| ConstraintIntersectionOnFlexibleTypes
| WarningWhenTailRecAttributeButNonTailRecUsage
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.

Loading
Loading