From 572b01fc5b03829b4992be072e0ff421597761ec Mon Sep 17 00:00:00 2001 From: Copilot Date: Thu, 10 Sep 2026 17:52:40 +0200 Subject: [PATCH] Remove always-on RequiredPropertiesSupport flag Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Compiler/Checking/Expressions/CheckExpressions.fs | 7 +++---- src/Compiler/FSComp.txt | 1 - src/Compiler/Facilities/LanguageFeatures.fs | 3 --- src/Compiler/Facilities/LanguageFeatures.fsi | 1 - src/Compiler/xlf/FSComp.txt.cs.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.de.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.es.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.fr.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.it.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.ja.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.ko.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.pl.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.ru.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.tr.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 ----- 17 files changed, 3 insertions(+), 74 deletions(-) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index fb2ddc9b18d..18d6ba0e27d 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -1288,8 +1288,7 @@ let CheckRequiredProperties (g:TcGlobals) (env: TcEnv) (cenv: TcFileState) (minf // 2.1. If there are none, proceed as usual // 2.2. If there are any, make sure all of them (or their setters) are in `finalAssignedItemSetters`. // 3. If some are missing, produce a diagnostic which missing ones. - if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) - && minfo.IsConstructor + if minfo.IsConstructor && not (minfo.GetCustomAttrs().HasWellKnownAttribute(WellKnownILAttributes.SetsRequiredMembersAttribute)) then @@ -10013,7 +10012,7 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItemIdent nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag None delayed else - if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) && pinfo.IsSetterInitOnly then + if pinfo.IsSetterInitOnly then errorR (Error(FSComp.SR.tcInitOnlyPropertyCannotBeSet1 (RichText.mkProperty nm), mItemIdent)) let args = if pinfo.IsIndexer then args else [] @@ -10955,7 +10954,7 @@ and TcSetterArgExpr (cenv: cenv) env denv objExpr ad assignedSetter calledFromCo CheckPropInfoAttributes pinfo id.idRange |> CommitOperationResult - if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) && pinfo.IsSetterInitOnly && not calledFromConstructor then + if pinfo.IsSetterInitOnly && not calledFromConstructor then errorR (Error(FSComp.SR.tcInitOnlyPropertyCannotBeSet1 (RichText.mkProperty pinfo.PropertyName), m)) MethInfoChecks g cenv.amap true None [objExpr] ad m pminfo diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index a50d902136b..db897b4bcd3 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1567,7 +1567,6 @@ 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" -featureRequiredProperties,"support for required properties" 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" diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index e03b60f7031..26fae9ccf01 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -30,7 +30,6 @@ type LanguageFeature = | AttributesToRightOfModuleKeyword | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess - | RequiredPropertiesSupport | SelfTypeConstraints | MatchNotAllowedForUnionCaseWithNoData | CSharpExtensionAttributeNotRequired @@ -137,7 +136,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) // F# 7.0 LanguageFeature.ReallyLongLists, languageVersion70 LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess, languageVersion70 - LanguageFeature.RequiredPropertiesSupport, languageVersion70 LanguageFeature.SelfTypeConstraints, languageVersion70 // F# 8.0 @@ -312,7 +310,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) | LanguageFeature.AttributesToRightOfModuleKeyword -> FSComp.SR.featureAttributesToRightOfModuleKeyword () | LanguageFeature.ReallyLongLists -> FSComp.SR.featureReallyLongList () | LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess -> FSComp.SR.featureErrorOnDeprecatedRequireQualifiedAccess () - | LanguageFeature.RequiredPropertiesSupport -> FSComp.SR.featureRequiredProperties () | LanguageFeature.SelfTypeConstraints -> FSComp.SR.featureSelfTypeConstraints () | LanguageFeature.MatchNotAllowedForUnionCaseWithNoData -> FSComp.SR.featureMatchNotAllowedForUnionCaseWithNoData () | LanguageFeature.CSharpExtensionAttributeNotRequired -> FSComp.SR.featureCSharpExtensionAttributeNotRequired () diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 36e1336e6ea..1125b194466 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -20,7 +20,6 @@ type LanguageFeature = | AttributesToRightOfModuleKeyword | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess - | RequiredPropertiesSupport | SelfTypeConstraints | MatchNotAllowedForUnionCaseWithNoData | CSharpExtensionAttributeNotRequired diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 36028a7a60c..8c06a4fd547 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -532,11 +532,6 @@ informační zprávy související s referenčními buňkami - - support for required properties - podpora požadovaných vlastností - - resumable state machines obnovitelné stavové stroje diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 701a63c7a2b..fc23d573f23 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -532,11 +532,6 @@ Informationsmeldungen im Zusammenhang mit Bezugszellen - - support for required properties - Unterstützung für erforderliche Eigenschaften - - resumable state machines Fortsetzbarer Zustand-Maschinen diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 81b95e31980..ed385b93e32 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -532,11 +532,6 @@ mensajes informativos relacionados con las celdas de referencia - - support for required properties - compatibilidad con las propiedades necesarias - - resumable state machines máquinas de estado reanudables diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 09fa4eee455..d4eea96efd2 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -532,11 +532,6 @@ messages d’information liés aux cellules de référence - - support for required properties - prise en charge des propriétés obligatoires - - resumable state machines ordinateurs d’état pouvant être repris diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index f2a1d4bd1f8..0003117aad6 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -532,11 +532,6 @@ messaggi informativi relativi alle celle di riferimento - - support for required properties - supporto per le proprietà obbligatorie - - resumable state machines macchine a stati ripristinabili diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index bdda682c3f1..847b9df0938 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -532,11 +532,6 @@ 参照セルに関連する情報メッセージ - - support for required properties - 必要なプロパティのサポート - - resumable state machines 再開可能なステート マシン diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index d14f780060f..2d60fc38795 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -532,11 +532,6 @@ 참조 셀과 관련된 정보 메시지 - - support for required properties - 필수 속성 지원 - - resumable state machines 다시 시작 가능한 상태 시스템 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 79b65f951b3..4ee38455ed8 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -532,11 +532,6 @@ komunikaty informacyjne związane z odwołaniami do komórek - - support for required properties - obsługa wymaganych właściwości - - resumable state machines automaty stanów z możliwością wznowienia diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index d01eeffa3ee..c6d18ed5914 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -532,11 +532,6 @@ mensagens informativas relacionadas a células de referência - - support for required properties - suporte para propriedades necessárias - - resumable state machines máquinas de estado retomável diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 7fec1c621d2..3b0fcdff00a 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -532,11 +532,6 @@ информационные сообщения, связанные с ссылочными ячейками - - support for required properties - поддержка обязательных свойств - - resumable state machines возобновляемые конечные автоматы diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 5b5ae8760e7..4b78492894b 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -532,11 +532,6 @@ başvuru hücreleriyle ilgili bilgi mesajları - - support for required properties - gerekli özellikler için destek - - resumable state machines sürdürülebilir durum makineleri diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index f93ff12bced..3b194db4113 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -532,11 +532,6 @@ 与引用单元格相关的信息性消息 - - support for required properties - 对所需属性的支持 - - resumable state machines 可恢复状态机 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 801fa62942d..4974de24acb 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -532,11 +532,6 @@ 與參考儲存格相關的資訊訊息 - - support for required properties - 對所需屬性的支援 - - resumable state machines 可繼續的狀態機器