From 15b5a6ce4bf34c03ef172e1e01eedd7e039cc5c4 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 7 Aug 2024 11:41:48 -0700 Subject: [PATCH] Update DefaultAugmentationAttribute (#17502) * Update DefaultAugmentationAttribute * readme --- docs/release-notes/.FSharp.Core/9.0.100.md | 2 +- src/FSharp.Core/prim-types.fs | 4 ++-- src/FSharp.Core/prim-types.fsi | 2 +- .../Conformance/Types/UnionTypes/UnionStructTypes.fs | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/.FSharp.Core/9.0.100.md b/docs/release-notes/.FSharp.Core/9.0.100.md index 9438303a7ed..50d799c4c9e 100644 --- a/docs/release-notes/.FSharp.Core/9.0.100.md +++ b/docs/release-notes/.FSharp.Core/9.0.100.md @@ -8,6 +8,6 @@ ### Changed * Change compiler default setting realsig+ when building assemblies ([Issue #17384](https://github.com/dotnet/fsharp/issues/17384), [PR #17378](https://github.com/dotnet/fsharp/pull/17385)) * Change compiler default setting for compressedMetadata ([Issue #17379](https://github.com/dotnet/fsharp/issues/17379), [PR #17383](https://github.com/dotnet/fsharp/pull/17383)) - +* Struct UnionCase doesn't seem to be a valid target for the DefaultAugmentationAttribute ([Issue #17499](https://github.com/dotnet/fsharp/issues/17499), [PR #17502](https://github.com/dotnet/fsharp/pull/17502)) ### Breaking Changes diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 211496b99d1..b5bcc6c28ba 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -90,7 +90,7 @@ namespace Microsoft.FSharp.Core type VolatileFieldAttribute() = inherit Attribute() - [] + [] [] type DefaultAugmentationAttribute(value:bool) = inherit Attribute() @@ -106,7 +106,7 @@ namespace Microsoft.FSharp.Core type CLIMutableAttribute() = inherit Attribute() - [] + [] [] type AutoSerializableAttribute(value:bool) = inherit Attribute() diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index 8b35a81e886..79b73df66e7 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -324,7 +324,7 @@ namespace Microsoft.FSharp.Core /// and accessor members for the generated CLI class for that type. /// /// Attributes - [] + [] [] type DefaultAugmentationAttribute = inherit Attribute diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs index 574f1695d62..a202d3b03cb 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs @@ -778,6 +778,7 @@ type Foo = let foo = [Baz 42; Bat; Batman] printf "%A" foo""" + |> withLangVersionPreview |> asExe |> compile |> shouldSucceed