Skip to content

Commit 42648f1

Browse files
committed
workaround Swift 6 compiler bug
1 parent 595148e commit 42648f1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sources/MarkdownPluginSwift/Signatures/Signature.Abridged (ext).swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ extension Signature.Abridged
2121
}
2222

2323
@usableFromInline
24-
init(utf8:consuming [UInt8])
24+
init(utf8:__owned [UInt8])
2525
{
26-
// There seems to be a bug in SwiftSyntax that causes misalignment of source ranges
27-
// when trimming leading trivia from syntax nodes. As a temporary workaround, we
28-
// replace all newline characters with space characters before parsing the source.
26+
/// https://github.com/swiftlang/swift/issues/75312
27+
var utf8:[UInt8] = consume utf8
28+
29+
// TODO: we should replace this workaround with the pattern suggested in
30+
// https://github.com/swiftlang/swift-syntax/issues/2687
2931
for i:Int in utf8.indices
3032
{
3133
switch utf8[i]

0 commit comments

Comments
 (0)