Skip to content

Commit

Permalink
Add feature flag for obj-inference diagnostic (#15315)
Browse files Browse the repository at this point in the history
* Add feature flag for obj-inference diagnostic

* FSI
  • Loading branch information
Smaug123 authored Jun 6, 2023
1 parent 5fcabc9 commit 55e2c71
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1694,4 +1694,5 @@ featureEscapeBracesInFormattableString,"Escapes curly braces before calling Form
3563,lexInvalidIdentifier,"This is not a valid identifier"
3564,parsMissingUnionCaseName,"Missing union case name"
3565,parsExpectingType,"Expecting type"
featureInformationalObjInferenceDiagnostic,"Diagnostic 3559 (warn when obj inferred) at informational level, off by default"
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."
3 changes: 3 additions & 0 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type LanguageFeature =
| ExtendedStringInterpolation
| WarningWhenMultipleRecdTypeChoice
| ImprovedImpliedArgumentNames
| DiagnosticForObjInference

/// LanguageVersion management
type LanguageVersion(versionText) =
Expand Down Expand Up @@ -161,6 +162,7 @@ type LanguageVersion(versionText) =
LanguageFeature.ExtendedStringInterpolation, previewVersion
LanguageFeature.WarningWhenMultipleRecdTypeChoice, previewVersion
LanguageFeature.ImprovedImpliedArgumentNames, previewVersion
LanguageFeature.DiagnosticForObjInference, previewVersion

]

Expand Down Expand Up @@ -285,6 +287,7 @@ type LanguageVersion(versionText) =
| LanguageFeature.ExtendedStringInterpolation -> FSComp.SR.featureExtendedStringInterpolation ()
| LanguageFeature.WarningWhenMultipleRecdTypeChoice -> FSComp.SR.featureWarningWhenMultipleRecdTypeChoice ()
| LanguageFeature.ImprovedImpliedArgumentNames -> FSComp.SR.featureImprovedImpliedArgumentNames ()
| LanguageFeature.DiagnosticForObjInference -> FSComp.SR.featureInformationalObjInferenceDiagnostic ()

/// Get a version string associated with the given feature.
static member GetFeatureVersionString feature =
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/Facilities/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ type LanguageFeature =
| ExtendedStringInterpolation
| WarningWhenMultipleRecdTypeChoice
| ImprovedImpliedArgumentNames
| DiagnosticForObjInference

/// LanguageVersion management
type LanguageVersion =
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">Notace expr[idx] pro indexování a vytváření řezů</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">podpora využívání vlastností init</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">expr[idx]-Notation zum Indizieren und Aufteilen</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">Unterstützung für die Nutzung von Initialisierungseigenschaften</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">Notación para indexación y segmentación expr[idx]</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">compatibilidad con el consumo de propiedades init</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">Notation expr[idx] pour l’indexation et le découpage</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">prise en charge de la consommation des propriétés init</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">Notazione expr[idx] per l'indicizzazione e il sezionamento</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">supporto per l'utilizzo delle proprietà init</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">インデックス作成とスライス用の expr[idx] 表記</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">init プロパティの使用のサポート</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">인덱싱 및 슬라이싱을 위한 expr[idx] 표기법</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">init 속성 사용 지원</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">notacja wyrażenia expr[idx] do indeksowania i fragmentowania</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">obsługa używania właściwości init</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">notação expr[idx] para indexação e fatia</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">suporte para consumir propriedades de inicialização</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">expr[idx] для индексации и среза</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">поддержка использования свойств инициализации</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">Dizin oluşturma ve dilimleme için expr[idx] gösterimi</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">başlatma özelliklerini kullanma desteği</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">用于索引和切片的 expr[idx] 表示法</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">支持使用 init 属性</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@
<target state="translated">用於編製索引和分割的 expr[idx] 註釋</target>
<note />
</trans-unit>
<trans-unit id="featureInformationalObjInferenceDiagnostic">
<source>Diagnostic 3559 (warn when obj inferred) at informational level, off by default</source>
<target state="new">Diagnostic 3559 (warn when obj inferred) at informational level, off by default</target>
<note />
</trans-unit>
<trans-unit id="featureInitProperties">
<source>support for consuming init properties</source>
<target state="translated">支援使用 init 屬性</target>
Expand Down

0 comments on commit 55e2c71

Please sign in to comment.