Source Breaking Change in Swift 6.3

Hi,

I think I found a source-breaking change in Swift 6.3.

Consider the following program:

import Foundation

protocol Attribute {}
struct Anchor: Attribute {}

extension Anchor {
    func yolo(_ str: String, hardMode: Bool = true) -> Self {
        print("In anchor")
        return self
    }
}

extension Attribute {
    func yolo(_ str: String) -> Self {
        print("In attribute")
        return self
    }
}

let a = Anchor()
_ = a.yolo("yolo")

Running it with Swift 6.2.3 will print In anchor, running it with Swift 6.3-snapshot-2026-02-26 will print In attribute.

1 Like

Would you mind filing it at github.com/swiftlang/swift/issues and posting a link to the new issue here? Thanks!

2 Likes

Sure! There you go: Source breaking change in Swift 6.3 · Issue #87566 · swiftlang/swift · GitHub.

5 Likes