-
Notifications
You must be signed in to change notification settings - Fork 825
Open
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.help wanted
Milestone
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
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.help wanted
Type
Projects
Status
New