Skip to content

Struct UnionCase doesn't seem to be a valid target for the DefaultAugmentationAttribute #17499

@KevinRansom

Description

@KevinRansom

Repro:
This fails to build with F# 9.0 (or preview) enabled

[]
[<DefaultAugmentation(false)>]
type Foo =
| Baz of int
| Bat
| Batman

let foo = [Baz 42; Bat; Batman]
printf "%A" foo
c:\temp>c:\kevinransom\fsharp\artifacts\bin\fsc\Release\net472\fsc foo.fs
Microsoft (R) F# Compiler version 12.9.100.0 for F# 9.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

foo.fs(2,3): error FS0842: This attribute is not valid for use on this language element

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions