Skip to content

Swift Testing macro not fully qualifying types in its expansion #1641

@bwdmr

Description

@bwdmr

Description

there is a type Comment in Library swift-openapi-generator[https://github.com/apple/swift-openapi-generator]
and the type Testing.Comment from the swift testing library.

applying the type in the expect macro does not appear in the expansion.

#expect(
                    safeNameGenerator.swiftTypeName(for: input) == idiomaticUpper,
                    Testing.Comment(stringLiteral: "Idiomatic upper, input: \(input)")
                )
...
Testing.__checkBinaryOperation(safeNameGenerator.swiftTypeName(for: input),{ $0 == $1() },idiomaticUpper,expression: .__fromBinaryOperation(.__fromSyntaxNode("safeNameGenerator.swiftTypeName(for: input)"),"==",.__fromSyntaxNode("idiomaticUpper")),comments: ([Testing.Comment(stringLiteral: "Idiomatic upper, input: \(input)")] as [Comment?]).compactMap(\.self),isRequired: false,sourceLocation: Testing.SourceLocation.__here()).__expected()

Reproduction

https://github.com/bwdmr/swift-openapi-generator/tree/support_swifttesting

here is a branch, any test in Tests/OpenAPIGeneratorCoreTests ran to observe the error.

Expected behavior

for the expansion to differentiate.

Environment

swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1)
Target: arm64-apple-macosx26.0

Additional information

No response

Metadata

Metadata

Assignees

Labels

bug🪲 Something isn't workingmacros🔭 Related to Swift macros such as @Test or #expect

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions