Skip to content

Commit

Permalink
workaround Swift 6 compiler bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tayloraswift committed Jul 17, 2024
1 parent 595148e commit 42648f1
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ extension Signature.Abridged
}

@usableFromInline
init(utf8:consuming [UInt8])
init(utf8:__owned [UInt8])
{
// There seems to be a bug in SwiftSyntax that causes misalignment of source ranges
// when trimming leading trivia from syntax nodes. As a temporary workaround, we
// replace all newline characters with space characters before parsing the source.
/// https://github.com/swiftlang/swift/issues/75312
var utf8:[UInt8] = consume utf8

// TODO: we should replace this workaround with the pattern suggested in
// https://github.com/swiftlang/swift-syntax/issues/2687
for i:Int in utf8.indices
{
switch utf8[i]
Expand Down

0 comments on commit 42648f1

Please sign in to comment.