Fixes compilation error for enum cases without associated values that have trailing comments e.g.:
// Using swift-case-paths 1.4.1
@CasePathable enum Foo {
case fizz(buzz: String) // Comment on case ✅
case fizziest // Comment without associated value ❌
}
Previously, for trailing comments on enum cases without associated values, the macro was generating invalid syntax in ~two~ one place (the first was fixed by #162):
// public struct AllCasePaths: Sequence {
case .fizziest // Comment without associated value: return \.fizziest ❌
// public func makeIterator() -> IndexingIterator<[PartialCaseKeyPath<Foo>]> {
allCasePaths.append(\.fizziest // Comment without associated value) ❌
I used the same fix from #160 – adding .text. This has the side-effect of removing C-style comments outside the root enum declaration as mentioned in this comment, which I believe is not a problem.
Fixes compilation error for enum cases without associated values that have trailing comments e.g.:
Previously, for trailing comments on enum cases without associated values, the macro was generating invalid syntax in ~two~ one place (the first was fixed by #162):
I used the same fix from #160 – adding
.text
. This has the side-effect of removing C-style comments outside the root enum declaration as mentioned in this comment, which I believe is not a problem.