Skip to content

@Test doesn't work consistently on operator functionsΒ #1204

@hamishknight

Description

@hamishknight

This works:

prefix operator ^

@Test(arguments: [(0)])
prefix func ^(_ lhs: Int) {
  #expect(1 == 3)
}

But if you remove the _ argument label or change it to an infix or postfix operator, you get a compiler error in the macro expansion. Either @Test should properly handle these cases or the macro should detect and reject attempts to use it on an operator.

Metadata

Metadata

Assignees

Labels

bugπŸͺ² Something isn't workingmacrosπŸ”­ Related to Swift macros such as @Test or #expecttriagedThis issue has undergone initial triage

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions