Capture list in #withImplicits blocked by Swift compiler bug
Open
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 43
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Description
Using capture lists with #withImplicits macro fails due to a Swift compiler bug with type inference for macro-expanded closures.
Example
let x = 42
_ = #withImplicits { [x] scope in
@Implicit() var v1: Int32
return x
}
This fails with: type of expression is ambiguous without a type annotation
Related
- Swift bug report: https://github.com/swiftlang/swift/issues/86871
Status
Test added but disabled with #if NO_COMPILE until Swift fixes the issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the capture-list example in the issue and the linked Swift compiler report #86871, then inspect the test mentioned as disabled with #if NO_COMPILE. Done would require the compiler bug to be resolved and the capture-list test to compile and pass without that guard.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100