From 45ca0aae0d7dcfb2b422a307dfcf2183f92735f4 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Fri, 6 Jan 2023 16:55:35 +0100 Subject: [PATCH 1/2] Compiler error when using instance members on static class --- src/Compiler/Checking/CheckDeclarations.fs | 4 +- src/Compiler/FSComp.txt | 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 ++ .../Language/StaticClassTests.fs | 53 ++++++++++++++++++- 16 files changed, 121 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index f37281a9334..a501f74edc0 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -1663,7 +1663,9 @@ let private ReportErrorOnStaticClass (synMembers: SynMemberDefn list) = errorR(Error(FSComp.SR.chkConstructorWithArgumentsOnStaticClasses(), pat.Range)) | SynMemberDefn.Member(SynBinding(valData = SynValData(memberFlags = Some memberFlags)), m) when memberFlags.MemberKind = SynMemberKind.Constructor -> - errorR(Error(FSComp.SR.chkAdditionalConstructorOnStaticClasses(), m)); + errorR(Error(FSComp.SR.chkAdditionalConstructorOnStaticClasses(), m)) + | SynMemberDefn.Member(SynBinding(valData = SynValData(memberFlags = Some memberFlags)), m) when memberFlags.MemberKind = SynMemberKind.Member && memberFlags.IsInstance -> + errorR(Error(FSComp.SR.chkInstanceMemberOnStaticClasses(), m)); | _ -> () /// Check and generalize the interface implementations, members, 'let' definitions in a mutually recursive group of definitions. diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index f3093995c52..223812ce813 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1668,3 +1668,4 @@ featureEscapeBracesInFormattableString,"Escapes curly braces before calling Form 3551,buildDuplicateFile,"The source file '%s' (at position %d/%d) already appeared in the compilation list (at position %d/%d). Please verify that it is included only once in the project file." 3552,chkConstructorWithArgumentsOnStaticClasses,"If a type uses both [] and [] attributes, it means it is static. Constructor with arguments is not allowed." 3553,chkAdditionalConstructorOnStaticClasses,"If a type uses both [] and [] attributes, it means it is static. Additional constructor is not allowed." +3554,chkInstanceMemberOnStaticClasses,"If a type uses both [] and [] attributes, it means it is static. Instance member is not allowed." diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 130db8ee110..ea790d75c31 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -72,6 +72,11 @@ Použití incr z knihovny F# je zastaralé. Více informací: https://aka.ms/fsharp-refcell-ops. Změňte prosím například incr cell na cell.Value <- cell.Value + 1. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. Atribut AssemblyKeyNameAttribute je zastaralý. Použijte místo něj AssemblyKeyFileAttribute. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index b26f864cffd..d359ee437d5 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -72,6 +72,11 @@ Die Verwendung von "incr" aus der F#-Bibliothek ist veraltet. Siehe https://aka.ms/fsharp-refcell-ops. Ändern Sie z. B. "incr cell" in "cell.Value <- cell.Value + 1". + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. "AssemblyKeyNameAttribute" gilt als veraltet. Verwenden Sie stattdessen "AssemblyKeyFileAttribute". diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index d16f78b54c6..0145a5116d6 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -72,6 +72,11 @@ El uso de "incr" de la biblioteca de F# está en desuso. Vea https://aka.ms/fsharp-refcell-ops. Por ejemplo, cambie "incr cell" a "cell.Value <- cell.Value + 1". + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. El elemento "AssemblyKeyNameAttribute" está en desuso. Use "AssemblyKeyFileAttribute" en su lugar. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 8f6f1db98e5..37774069538 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -72,6 +72,11 @@ L’utilisation de « incr » à partir de la bibliothèque F# est déconseillée. Voir https://aka.ms/fsharp-refcell-ops. Par exemple, veuillez remplacer « incr cell » par « cell.Value <- cell.Value + 1 ». + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' a été déprécié. Utilisez 'AssemblyKeyFileAttribute' à la place. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index ea56b0f7e4a..2ef2dc9b392 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -72,6 +72,11 @@ L'uso di 'incr' dalla libreria F # è deprecato. Vedere https://aka.ms/fsharp-refcell-ops. Ad esempio, modificare 'incr cell' in 'cell.Value <- cell.Value + 1'. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. L'attributo 'AssemblyKeyNameAttribute' è deprecato. In alternativa, usare 'AssemblyKeyFileAttribute'. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 8cda9edc1d7..b05ae88dd56 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -72,6 +72,11 @@ F# ライブラリからの 'incr' の使用は非推奨です。https://aka.ms/fsharp-refcell-ops を参照してください。たとえば、'incr cell' を 'cell.Value <- cell.Value +1' に変更してください。 + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' は非推奨になりました。代わりに 'AssemblyKeyFileAttribute' を使用してください。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 4e77efd30d0..896580627e6 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -72,6 +72,11 @@ F# 라이브러리의 'incr' 사용은 더 이상 사용되지 않습니다. https://aka.ms/fsharp-refcell-ops를 참조하세요. 예를 들어 'incr cell'을 'cell.Value <- cell.Value + 1'로 변경하세요. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute'는 사용되지 않습니다. 대신 'AssemblyKeyFileAttribute'를 사용하세요. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index a7033af6dfb..64f29f8c0ab 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -72,6 +72,11 @@ Użycie elementu „incr” z biblioteki języka F# jest przestarzałe. Sprawdź stronę https://aka.ms/fsharp-refcell-ops. Na przykład zmień wyrażenie „incr cell” na „cell.Value <- cell.Value + 1”. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. Element „AssemblyKeyNameAttribute” jest przestarzały. Zamiast niego użyj elementu „AssemblyKeyFileAttribute”. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 1c55ec02e84..67fd5cac7da 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -72,6 +72,11 @@ O uso de 'incr' da biblioteca F# foi preterido. Consulte https://aka.ms/fsharp-refcell-ops. Por exemplo, altere a célula 'incr cell' para 'cell.Value <- cell.Value + 1'. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. O 'AssemblyKeyNameAttribute' foi preterido. Use o 'AssemblyKeyFileAttribute'. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 157486c8073..69bf6d8243d 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -72,6 +72,11 @@ Использование "incr" из библиотеки F# является нерекомендуемым. См. https://aka.ms/fsharp-refcell-ops. Например, замените "incr cell" на "cell.Value <- cell.Value + 1". + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. Атрибут "AssemblyKeyNameAttribute" является устаревшим. Используйте вместо него атрибут "AssemblyKeyFileAttribute". diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 0923ca2d0f7..7be18a955b3 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -72,6 +72,11 @@ F# kitaplığından gelen 'incr' kullanımı kullanım dışı. https://aka.ms/fsharp-refcell-ops’a bakın. Örneğin, lütfen 'incr cell' ifadesini 'cell.Value <- cell.Value + 1' olarak değiştirin. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' kullanım dışı bırakıldı. Bunun yerine 'AssemblyKeyFileAttribute' kullanın. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 3aa9bc0222c..497ed4a8b66 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -72,6 +72,11 @@ 已弃用 F# 库中的“incr”。请参阅 https://aka.ms/fsharp-refcell-ops。 例如,请将“incr cell”更改为“cell.Value <- cell.Value + 1”。 + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. "AssemblyKeyNameAttribute" 已被弃用。请改为使用 "AssemblyKeyFileAttribute"。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 7452751a967..52d9f17ffeb 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -72,6 +72,11 @@ 透過 F# 程式庫使用 'incr' 的方式已淘汰。請參閱 https://aka.ms/fsharp-refcell-ops。舉例來說,請將 'incr cell' 變更為 'cell.Value <- cell.Value + 1'。 + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' 已淘汰。請改用 'AssemblyKeyFileAttribute'。 diff --git a/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs index c612d762c2b..c2cc3122fea 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs @@ -201,4 +201,55 @@ type B = Fs code |> withLangVersion langVersion |> compile - |> shouldSucceed \ No newline at end of file + |> shouldSucceed + + [] + let ``Sealed and AbstractClass on on a type with instance members in lang version70`` () = + Fsx """ +[] +type T() = + member this.M() = () + static member X = 1 + """ + |> withLangVersion70 + |> compile + |> shouldSucceed + + [] + let ``Sealed and AbstractClass on on a type with instance members in lang preview`` () = + Fsx """ +[] +type T() = + member this.M() = () + static member X = 1 + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3554, Line 4, Col 5, Line 4, Col 25, "If a type uses both [] and [] attributes, it means it is static. Instance member is not allowed.") + ] + + [] + let ``Sealed and AbstractClass on on a type with static members in lang version70`` () = + Fsx """ +[] +type T() = + static member M() = () + static member X = T.M() + """ + |> withLangVersion70 + |> compile + |> shouldSucceed + + [] + let ``Sealed and AbstractClass on on a type with static members in lang preview`` () = + Fsx """ +[] +type T() = + static member M() = () + static member X = T.M() + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed \ No newline at end of file From aaec8b917a64cdf66e51b91cd1d47228851016bb Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sat, 7 Jan 2023 08:56:27 +0100 Subject: [PATCH 2/2] Fix grammar --- src/Compiler/FSComp.txt | 2 +- src/Compiler/xlf/FSComp.txt.cs.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.de.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.es.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.fr.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.it.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.ja.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.ko.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.pl.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.ru.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.tr.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 4 ++-- .../Language/StaticClassTests.fs | 10 +++++----- 15 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 223812ce813..03ab28bfc97 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1668,4 +1668,4 @@ featureEscapeBracesInFormattableString,"Escapes curly braces before calling Form 3551,buildDuplicateFile,"The source file '%s' (at position %d/%d) already appeared in the compilation list (at position %d/%d). Please verify that it is included only once in the project file." 3552,chkConstructorWithArgumentsOnStaticClasses,"If a type uses both [] and [] attributes, it means it is static. Constructor with arguments is not allowed." 3553,chkAdditionalConstructorOnStaticClasses,"If a type uses both [] and [] attributes, it means it is static. Additional constructor is not allowed." -3554,chkInstanceMemberOnStaticClasses,"If a type uses both [] and [] attributes, it means it is static. Instance member is not allowed." +3554,chkInstanceMemberOnStaticClasses,"If a type uses both [] and [] attributes, it means it is static. Instance members are not allowed." diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index ea790d75c31..e2477998461 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index d359ee437d5..a3d68b6bde1 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 0145a5116d6..3dcd9a96d4e 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 37774069538..06bdee98069 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 2ef2dc9b392..6da5546c729 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index b05ae88dd56..2a493955d6f 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 896580627e6..ef266833a3d 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 64f29f8c0ab..9ac9aab7e10 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 67fd5cac7da..15594c8ad01 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 69bf6d8243d..5da5e9edb15 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 7be18a955b3..9cbd059ab60 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 497ed4a8b66..f01de0338e6 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 52d9f17ffeb..8d34c0cf216 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -73,8 +73,8 @@ - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. - If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance member is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. diff --git a/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs index c2cc3122fea..b6a2f32e2f1 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs @@ -204,7 +204,7 @@ type B = |> shouldSucceed [] - let ``Sealed and AbstractClass on on a type with instance members in lang version70`` () = + let ``Sealed and AbstractClass on a type with instance members in lang version70`` () = Fsx """ [] type T() = @@ -216,7 +216,7 @@ type T() = |> shouldSucceed [] - let ``Sealed and AbstractClass on on a type with instance members in lang preview`` () = + let ``Sealed and AbstractClass on a type with instance members in lang preview`` () = Fsx """ [] type T() = @@ -227,11 +227,11 @@ type T() = |> compile |> shouldFail |> withDiagnostics [ - (Error 3554, Line 4, Col 5, Line 4, Col 25, "If a type uses both [] and [] attributes, it means it is static. Instance member is not allowed.") + (Error 3554, Line 4, Col 5, Line 4, Col 25, "If a type uses both [] and [] attributes, it means it is static. Instance members are not allowed.") ] [] - let ``Sealed and AbstractClass on on a type with static members in lang version70`` () = + let ``Sealed and AbstractClass on a type with static members in lang version70`` () = Fsx """ [] type T() = @@ -243,7 +243,7 @@ type T() = |> shouldSucceed [] - let ``Sealed and AbstractClass on on a type with static members in lang preview`` () = + let ``Sealed and AbstractClass on a type with static members in lang preview`` () = Fsx """ [] type T() =