-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
associated type inferencebugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels
Description
Description
the following example produces the error Reference to invalid type alias 'Snapshot' of type 'PluginBundleCache'
on 6.0.3, and on main
the nested class D
seems to be the trigger for the compiler bug, relocating it after the f(_:)
witness, instead of before, inexplicably resolves the error.
Reproduction
class C<T> {
init() {}
}
protocol P<ObjectEntry>: Sendable {
associatedtype ObjectEntry
associatedtype Object
typealias Snapshot = C<ObjectEntry>
func f(_: Snapshot)
}
protocol Q<Object>: P where Object == ObjectEntry {
}
final class PluginBundleCache: Q {
typealias Object = Int
class D: Snapshot {}
func f(_: Snapshot) {}
}
Expected behavior
it should typecheck successfully
Environment
% swift --version
swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0
Additional information
No response
Metadata
Metadata
Assignees
Labels
associated type inferencebugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels