Swift 6.1 Generic parameter could not be inferred

FYI the latest Swift 6.1 RCs include a source break where generic inference fails under specific circumstances. Issue#80146

enum LoadingState<Model> {
    case loaded(Model)

    func loaded() { }
}

extension LoadingState: Sendable where Model: Sendable { }

let state = LoadingState.loaded("fish") // ❌ Generic parameter 'Model' could not be inferred

Within the codebases I work with the easiest fix is to rename the instance method restoring inference.

1 Like