Post

Replies

Boosts

Views

Activity

Why doesn’t getAPI() show up in autocomplete despite having a default implementation in a protocol extension?
I’m working on a project in Xcode 16.2 and encountered an issue where getAPI() with a default implementation in a protocol extension doesn’t show up in autocomplete. Here’s a simplified version of the code: import Foundation public protocol Repository { func getAPI(from url: String?) } extension Repository { public func getAPI(from url: String? = "https://...") { getAPI(from: url) } } final class _Repository: Repository { func getAPI(from url: String?) { // Task... } } let repo: Repository = _Repository() repo.getAPI( // Autocomplete doesn't suggest getAPI() I’ve tried the following without success: • Clean build folder • Restart Xcode • Reindexing Is there something wrong with the code, or is this a known issue with Xcode 16.2? I’d appreciate any insights or suggestions.
0
0
60
11h