Skip to content

Trailing comma not allowed in @available annotation despite SE-0439 #81475

Open
@calda

Description

@calda

Description

Trailing commas are unexpectedly not allowed in @available annotations, despite annotations being mentioned as a supported use case in SE-0439.

@available(
    *,
    deprecated,
    renamed: "bar", // unexpectedly not allowed
)
func foo() { }

Reproduction

Compile the above code using Swift 6.1+: https://swiftfiddle.com/oiaoenmyxbcajdqv4m522kji3q

Expected behavior

It should compile but doesn't

Environment

Swift version 6.2-dev (LLVM a3e32cdaae72f3d, Swift fa86097)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    attributesFeature: Declaration and type attributesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfparserArea → compiler: The legacy C++ parserswift 6.2unexpected errorBug: Unexpected error

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions