Open
Description
Initially found following semantic kernel tutorial here: https://learn.microsoft.com/en-us/semantic-kernel/get-started/quick-start-guide?pivots=programming-language-csharp
It seems that C# allows multiple attribute usage on a different targets e.g. return:
in this case:
[AttributeUsage(AttributeTargets.All)]
public class Attr(string m) : Attribute;
public class Test()
{
[Attr("Foo")]
[return: Attr("Foo")]
public void Foo() {}
}
C# compiles ok while in this case:
[<AttributeUsage(AttributeTargets.All)>]
type Attr(m: string) =
inherit Attribute()
type Test() =
[<Attr("foo")>]
[<return: Attr("foo")>]
member _.Foo() = ()
F# compiler is compaining that AttributeUsage
is false. So my guess is that F# does not respect a different attribute target and simply checks if there are multiple attributes defined or not
I guess it is related to this: #11304 in some way
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
New