diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs
index 42710ee52d657547e52b1a8b0fc792394c365918..1d9d9da70fac59112ed25ce0042db073a8e673d3 100644
--- a/src/Compiler/Checking/CheckExpressions.fs
+++ b/src/Compiler/Checking/CheckExpressions.fs
@@ -2101,7 +2101,11 @@ let BuildFieldMap (cenv: cenv) env isPartial ty flds m =
if Map.containsKey fref2.FieldName fs then
errorR (Error(FSComp.SR.tcFieldAppearsTwiceInRecord(fref2.FieldName), m))
if showDeprecated then
- warning(Deprecated(FSComp.SR.nrRecordTypeNeedsQualifiedAccess(fref2.FieldName, fref2.Tycon.DisplayName) |> snd, m))
+ let diagnostic = Deprecated(FSComp.SR.nrRecordTypeNeedsQualifiedAccess(fref2.FieldName, fref2.Tycon.DisplayName) |> snd, m)
+ if g.langVersion.SupportsFeature(LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess) then
+ errorR(diagnostic)
+ else
+ warning(diagnostic)
if not (tyconRefEq g tcref fref2.TyconRef) then
let _, frefSet1, _ = List.head fldResolutions
@@ -2127,7 +2131,11 @@ let rec ApplyUnionCaseOrExn (makerForUnionCase, makerForExnTag) m (cenv: cenv) e
| Item.UnionCase(ucinfo, showDeprecated) ->
if showDeprecated then
- warning(Deprecated(FSComp.SR.nrUnionTypeNeedsQualifiedAccess(ucinfo.DisplayName, ucinfo.Tycon.DisplayName) |> snd, m))
+ let diagnostic = Deprecated(FSComp.SR.nrUnionTypeNeedsQualifiedAccess(ucinfo.DisplayName, ucinfo.Tycon.DisplayName) |> snd, m)
+ if g.langVersion.SupportsFeature(LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess) then
+ errorR(diagnostic)
+ else
+ warning(diagnostic)
let ucref = ucinfo.UnionCaseRef
CheckUnionCaseAttributes g ucref m |> CommitOperationResult
diff --git a/src/Compiler/Checking/CheckPatterns.fs b/src/Compiler/Checking/CheckPatterns.fs
index 1314fb2fdfa7d69b1659e56603eda9d0063fc85d..b39d6481517becfec25d56e76396930964dac569 100644
--- a/src/Compiler/Checking/CheckPatterns.fs
+++ b/src/Compiler/Checking/CheckPatterns.fs
@@ -568,7 +568,11 @@ and ApplyUnionCaseOrExn m (cenv: cenv) env overallTy item =
| Item.UnionCase(ucinfo, showDeprecated) ->
if showDeprecated then
- warning(Deprecated(FSComp.SR.nrUnionTypeNeedsQualifiedAccess(ucinfo.DisplayName, ucinfo.Tycon.DisplayName) |> snd, m))
+ let diagnostic = Deprecated(FSComp.SR.nrUnionTypeNeedsQualifiedAccess(ucinfo.DisplayName, ucinfo.Tycon.DisplayName) |> snd, m)
+ if g.langVersion.SupportsFeature(LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess) then
+ errorR(diagnostic)
+ else
+ warning(diagnostic)
let ucref = ucinfo.UnionCaseRef
CheckUnionCaseAttributes g ucref m |> CommitOperationResult
diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt
index 2cb1fb849781fdee4e3bc72df229634e4bb49f92..bf1989513f07fff353cfe4a958b8d62d82d396ac 100644
--- a/src/Compiler/FSComp.txt
+++ b/src/Compiler/FSComp.txt
@@ -1554,6 +1554,7 @@ featureAdditionalImplicitConversions,"additional type-directed conversions"
featureStructActivePattern,"struct representation for active patterns"
featureRelaxWhitespace2,"whitespace relaxation v2"
featureReallyLongList,"list literals of any size"
+featureErrorOnDeprecatedRequireQualifiedAccess,"give error on deprecated access of construct with RequireQualifiedAccess attribute"
3353,fsiInvalidDirective,"Invalid directive '#%s %s'"
3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation."
3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation."
diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs
index 6c2cc2055939af381b2ded88db41ddc60d6bed4b..6a6e57ee896ba75372ab1b2d1ee5e6de4ca3cc38 100644
--- a/src/Compiler/Facilities/LanguageFeatures.fs
+++ b/src/Compiler/Facilities/LanguageFeatures.fs
@@ -48,6 +48,7 @@ type LanguageFeature =
| BetterExceptionPrinting
| DelegateTypeNameResolutionFix
| ReallyLongLists
+ | ErrorOnDeprecatedRequireQualifiedAccess
/// LanguageVersion management
type LanguageVersion (versionText) =
@@ -106,6 +107,7 @@ type LanguageVersion (versionText) =
LanguageFeature.MLCompatRevisions,previewVersion
LanguageFeature.BetterExceptionPrinting,previewVersion
LanguageFeature.ReallyLongLists, previewVersion
+ LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess,previewVersion
]
static let defaultLanguageVersion = LanguageVersion("default")
@@ -205,6 +207,7 @@ type LanguageVersion (versionText) =
| LanguageFeature.BetterExceptionPrinting -> FSComp.SR.featureBetterExceptionPrinting()
| LanguageFeature.DelegateTypeNameResolutionFix -> FSComp.SR.featureDelegateTypeNameResolutionFix()
| LanguageFeature.ReallyLongLists -> FSComp.SR.featureReallyLongList()
+ | LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess -> FSComp.SR.featureErrorOnDeprecatedRequireQualifiedAccess()
/// Get a version string associated with the given feature.
member _.GetFeatureVersionString feature =
diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi
index a5f2e8bb1fd6761d32756fd7880ef0d1f3426e88..ec884903b49f0b99c326f5bf03eefaf6bf45f120 100644
--- a/src/Compiler/Facilities/LanguageFeatures.fsi
+++ b/src/Compiler/Facilities/LanguageFeatures.fsi
@@ -38,6 +38,7 @@ type LanguageFeature =
| BetterExceptionPrinting
| DelegateTypeNameResolutionFix
| ReallyLongLists
+ | ErrorOnDeprecatedRequireQualifiedAccess
/// LanguageVersion management
type LanguageVersion =
diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf
index b1fa4e2cf7c832ec468edafa0bd5254349eb2b40..151f341d14c5cb615c8cbeb304047d00814cd07b 100644
--- a/src/Compiler/xlf/FSComp.txt.cs.xlf
+++ b/src/Compiler/xlf/FSComp.txt.cs.xlf
@@ -157,6 +157,11 @@
literál float32 bez tečky
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measurevíce typů podporuje měrné jednotky
diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf
index 4d6f3fc0b088547fd246dfb14c08b6eb0c2f1a14..ade8740fa37f115ac726a3518a87df11325d1320 100644
--- a/src/Compiler/xlf/FSComp.txt.de.xlf
+++ b/src/Compiler/xlf/FSComp.txt.de.xlf
@@ -157,6 +157,11 @@
punktloses float32-Literal
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measureMaßeinheitenunterstützung durch weitere Typen
diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf
index 8d9e613caaf29d66391f84b18161aa7f7b37d855..5a6767dc03e76c4cb88b2ebc2bcba983befa4306 100644
--- a/src/Compiler/xlf/FSComp.txt.es.xlf
+++ b/src/Compiler/xlf/FSComp.txt.es.xlf
@@ -157,6 +157,11 @@
literal float32 sin punto
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measuremás tipos admiten las unidades de medida
diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf
index abb9cac58fb14014720f6a7766ad9c59564bbb19..b35af7646d80a49f164643d23671f28dc12ad584 100644
--- a/src/Compiler/xlf/FSComp.txt.fr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.fr.xlf
@@ -157,6 +157,11 @@
littéral float32 sans point
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measured'autres types prennent en charge les unités de mesure
diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf
index ea42495717cecd3c86ef1823189607265e259423..670f488ff43e9b995b87300048b82c3e506d49c0 100644
--- a/src/Compiler/xlf/FSComp.txt.it.xlf
+++ b/src/Compiler/xlf/FSComp.txt.it.xlf
@@ -157,6 +157,11 @@
valore letterale float32 senza punti
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measurepiù tipi supportano le unità di misura
diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf
index 7aca147dafc71a6800cda0f80ee81d26eea8dd17..06f422a854f2a417ca3806c731f92df9d35a6d31 100644
--- a/src/Compiler/xlf/FSComp.txt.ja.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ja.xlf
@@ -157,6 +157,11 @@
ドットなしの float32 リテラル
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measure単位をサポートするその他の型
diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf
index 756adccd3c3e4f97a6bf682bb38b85d75326ee4b..e7e3a0f922d555a6cb9cacf87bece76678216b0d 100644
--- a/src/Compiler/xlf/FSComp.txt.ko.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ko.xlf
@@ -157,6 +157,11 @@
점이 없는 float32 리터럴
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measure더 많은 형식이 측정 단위를 지원함
diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf
index 2f3076f0c5355455d1c5cbfb813f613b6009b7f3..1c0829bea4fb391d73fe1c6012330ce06d6bae3e 100644
--- a/src/Compiler/xlf/FSComp.txt.pl.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pl.xlf
@@ -157,6 +157,11 @@
bezkropkowy literał float32
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measurewięcej typów obsługuje jednostki miary
diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
index fe4f138ba45aae2eec5cd82128d951e728f454bb..68e52831e1cd4b0711dd60b51f2c5df3af322959 100644
--- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
@@ -157,6 +157,11 @@
literal float32 sem ponto
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measuremais tipos dão suporte para unidades de medida
diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf
index 9869da257994e9899a4350c7b0d15195a15e75da..9777e20b0ad36c67433f183b66be024d12f0f85f 100644
--- a/src/Compiler/xlf/FSComp.txt.ru.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ru.xlf
@@ -157,6 +157,11 @@
литерал float32 без точки
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measureдругие типы поддерживают единицы измерения
diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf
index 96a4421fcd2647f94e831ab676354b67eb3538a9..23432c905c60b2c1d667a81a21154c042bd7f14e 100644
--- a/src/Compiler/xlf/FSComp.txt.tr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.tr.xlf
@@ -157,6 +157,11 @@
noktasız float32 sabit değeri
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measuretür daha ölçü birimlerini destekler
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
index 745af28b564b7f4d02d6233fa170433b1943b112..e72481a46d7309708db88f785d3c298879f21e55 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
@@ -157,6 +157,11 @@
无点 float32 文本
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measure更多类型支持度量单位
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
index 84c81465e8def6192b17ff6a0c36ce455e8277df..d1f619a520a6348671bf9aed490808b05b64a2fa 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
@@ -157,6 +157,11 @@
無點號的 float32 常值
+
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+ give error on deprecated access of construct with RequireQualifiedAccess attribute
+
+ more types support units of measure更多支援測量單位的類型