From 26a71f38418c4d205bc7178f726f7a7932b9bd51 Mon Sep 17 00:00:00 2001 From: Nelson Wu Date: Tue, 3 Sep 2019 14:47:59 -0700 Subject: [PATCH 1/5] add test for feature --- .../Compiler/Language/TypeAttributeTests.fs | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/fsharp/Compiler/Language/TypeAttributeTests.fs diff --git a/tests/fsharp/Compiler/Language/TypeAttributeTests.fs b/tests/fsharp/Compiler/Language/TypeAttributeTests.fs new file mode 100644 index 00000000000..95ef8503625 --- /dev/null +++ b/tests/fsharp/Compiler/Language/TypeAttributeTests.fs @@ -0,0 +1,44 @@ +namespace FSharp.Compiler.UnitTests + +open NUnit.Framework +open FSharp.Compiler.SourceCodeServices + +[] +module TypeAttributeTests = + + [] + let ``Attribute can be assigned to type definition``() = + CompilerAssert.Pass + """ +[] +type Point = {x:int; y:int} + """ + [] + let ``Attribute cannot be assigned to optional type extension``() = + CompilerAssert.TypeCheckSingleError + """ +open System + +[] +type String with + member this.test = 42 + """ + FSharpErrorSeverity.Error + 3245 + (4, 1, 4, 15) + "Attributes cannot be assigned to type extensions." + + [] + let ``Attribute cannot be assigned to intrinsic type extension``() = + CompilerAssert.TypeCheckSingleError + """ +type Point = {x:int; y:int} + +[] +type Point with + member this.test = 42 + """ + FSharpErrorSeverity.Error + 3245 + (4, 1, 4, 15) + "Attributes cannot be assigned to type extensions." From 448cc486f80f7b6c6c85e44ebad4e36a1645b6b6 Mon Sep 17 00:00:00 2001 From: Nelson Wu Date: Tue, 3 Sep 2019 14:48:50 -0700 Subject: [PATCH 2/5] add error logic to typechecker --- src/fsharp/TypeChecker.fs | 5 +++++ tests/fsharp/FSharpSuite.Tests.fsproj | 1 + 2 files changed, 6 insertions(+) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 7610c4f209e..091b2f68738 100644 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -16429,6 +16429,11 @@ module TcDeclarations = if not (isNil members) && tcref.IsTypeAbbrev then errorR(Error(FSComp.SR.tcTypeAbbreviationsCannotHaveAugmentations(), tyDeclRange)) + let (ComponentInfo (attributes, _, _, _, _, _, _, _)) = synTyconInfo + if not (List.isEmpty attributes) && (declKind = ExtrinsicExtensionBinding || declKind = IntrinsicExtensionBinding) then + let attributeRange = (List.head attributes).Range + error(Error(FSComp.SR.tcAugmentationsCannotHaveAttributes(), attributeRange)) + MutRecDefnsPhase2DataForTycon(tyconOpt, innerParent, declKind, tcref, baseValOpt, safeInitInfo, declaredTyconTypars, members, tyDeclRange, newslotsOK, fixupFinalAttrs)) // By now we've established the full contents of type definitions apart from their diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 1b1d3386ac5..fc1e8d0e4b3 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -55,6 +55,7 @@ + From d5416b5f59b33a94307df1f44b50c6789a08efda Mon Sep 17 00:00:00 2001 From: Nelson Wu Date: Tue, 3 Sep 2019 14:49:06 -0700 Subject: [PATCH 3/5] update strings --- src/fsharp/FSComp.txt | 1 + src/fsharp/xlf/FSComp.txt.cs.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.de.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.es.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.fr.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.it.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.ja.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.ko.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.pl.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.ru.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.tr.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 5 +++++ src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 5 +++++ 14 files changed, 66 insertions(+) diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 831597c031a..5f8fe9f2739 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1461,6 +1461,7 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3243,parsInvalidAnonRecdExpr,"Invalid anonymous record expression" 3244,parsInvalidAnonRecdType,"Invalid anonymous record type" 3245,tcCopyAndUpdateNeedsRecordType,"The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record" +3245,tcAugmentationsCannotHaveAttributes,"Attributes cannot be assigned to type extensions." 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." useSdkRefs,"Use reference assemblies for .NET framework references when available (Enabled by default)." diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 7ff138f6adf..1f410a9e31c 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. Není definovaný obor názvů {0}. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 1645cfc2d52..00d9dddd6ae 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. Der Namespace "{0}" ist nicht definiert. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 279d16a7c90..4000c0937d4 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. El espacio de nombres "{0}" no está definido. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 0be131277cd..12b80e9989e 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. L'espace de noms '{0}' n'est pas défini. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 53ca4ca804e..b0fb92cca68 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. Lo spazio dei nomi '{0}' non è definito. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 25ad9ef7015..abb8097fc83 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. 名前空間 '{0}' が定義されていません。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index f1a4302d509..91db5b76025 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. '{0}' 네임스페이스가 정의되지 않았습니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index f50ce51d8dd..b7e56a30fc1 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. Nie zdefiniowano przestrzeni nazw „{0}”. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index cf3fbbae234..9684d01222a 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. O namespace '{0}' não está definido. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index f4c4134fda1..2bf2796a102 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. Пространство имен "{0}" не определено. diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 216c29567d6..6d56444776d 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. '{0}' ad alanı tanımlı değil. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index b2a9493d151..a1e0d3a5137 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. 未定义命名空间“{0}”。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index d9c19965864..44b72a376ab 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -17,6 +17,11 @@ Algorithm '{0}' is not supported + + Attributes cannot be assigned to type extensions. + Attributes cannot be assigned to type extensions. + + The namespace '{0}' is not defined. 未定義命名空間 '{0}'。 From 4196058a16c2b4577aaf71d7ebaeeace39cdb8c5 Mon Sep 17 00:00:00 2001 From: Nelson Wu Date: Wed, 4 Sep 2019 11:23:45 -0700 Subject: [PATCH 4/5] address comments --- src/fsharp/FSComp.txt | 2 +- src/fsharp/xlf/FSComp.txt.cs.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.de.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.es.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.fr.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.it.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.ja.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.ko.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.pl.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.ru.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.tr.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 4 ++-- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 4 ++-- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 5f8fe9f2739..e1eff2a2086 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1461,7 +1461,7 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3243,parsInvalidAnonRecdExpr,"Invalid anonymous record expression" 3244,parsInvalidAnonRecdType,"Invalid anonymous record type" 3245,tcCopyAndUpdateNeedsRecordType,"The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record" -3245,tcAugmentationsCannotHaveAttributes,"Attributes cannot be assigned to type extensions." +3246,tcAugmentationsCannotHaveAttributes,"Attributes cannot be applied to type extensions." 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." useSdkRefs,"Use reference assemblies for .NET framework references when available (Enabled by default)." diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 1f410a9e31c..94cd285b69a 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 00d9dddd6ae..32eb4893110 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 4000c0937d4..59cd5ac6aca 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 12b80e9989e..13d12054f2b 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index b0fb92cca68..2d75e7fd993 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index abb8097fc83..085b1b5c0b7 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 91db5b76025..34e15943a00 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index b7e56a30fc1..ca1578541e8 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 9684d01222a..2f4dd259360 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 2bf2796a102..00a7823fc27 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 6d56444776d..697fb5bbe03 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index a1e0d3a5137..db8f678d525 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 44b72a376ab..e737e76c880 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -18,8 +18,8 @@ - Attributes cannot be assigned to type extensions. - Attributes cannot be assigned to type extensions. + Attributes cannot be applied to type extensions. + Attributes cannot be applied to type extensions. From 2dcb41d91fb15d57cf074d76ca37e8e622c5d8d6 Mon Sep 17 00:00:00 2001 From: Nelson Wu Date: Wed, 4 Sep 2019 13:12:56 -0700 Subject: [PATCH 5/5] update tests --- .../fsharp/Compiler/Language/TypeAttributeTests.fs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/fsharp/Compiler/Language/TypeAttributeTests.fs b/tests/fsharp/Compiler/Language/TypeAttributeTests.fs index 95ef8503625..44a1cac08b7 100644 --- a/tests/fsharp/Compiler/Language/TypeAttributeTests.fs +++ b/tests/fsharp/Compiler/Language/TypeAttributeTests.fs @@ -7,14 +7,14 @@ open FSharp.Compiler.SourceCodeServices module TypeAttributeTests = [] - let ``Attribute can be assigned to type definition``() = + let ``Attribute can be applied to type definition``() = CompilerAssert.Pass """ [] type Point = {x:int; y:int} """ [] - let ``Attribute cannot be assigned to optional type extension``() = + let ``Attribute cannot be applied to optional type extension``() = CompilerAssert.TypeCheckSingleError """ open System @@ -24,12 +24,12 @@ type String with member this.test = 42 """ FSharpErrorSeverity.Error - 3245 + 3246 (4, 1, 4, 15) - "Attributes cannot be assigned to type extensions." + "Attributes cannot be applied to type extensions." [] - let ``Attribute cannot be assigned to intrinsic type extension``() = + let ``Attribute cannot be applied to intrinsic type extension``() = CompilerAssert.TypeCheckSingleError """ type Point = {x:int; y:int} @@ -39,6 +39,6 @@ type Point with member this.test = 42 """ FSharpErrorSeverity.Error - 3245 + 3246 (4, 1, 4, 15) - "Attributes cannot be assigned to type extensions." + "Attributes cannot be applied to type extensions."