Open JaapWijnen opened 2 months ago
tagging @asl
Tagging @slavapestov Maybe the underlying issue is same as in https://github.com/swiftlang/swift/issues/75711
This is a different issue. Reduction:
protocol P {}
struct G<T> {}
extension G where A: P {
typealias A = T
}
It's a request cycle:
===CYCLE DETECTED===
`--TypeCheckSourceFileRequest(source_file "/Users/spestov/src/swift/x.swift")
`--GenericSignatureRequest(extension of G@/Users/spestov/src/swift/x.swift:4:1)
`--InferredGenericSignatureRequest(<T where T : Copyable, T : Escapable>, (null), extension of G@/Users/spestov/src/swift/x.swift:4:1, {}, {}, , 1, 1)
`--RequirementRequest(extension of G@/Users/spestov/src/swift/x.swift:4:1, 0, structural)
`--ResolveTypeRequest(while resolving type , A)
`--UnqualifiedLookupRequest(looking up 'A' from 0x1380a8f20 ExtensionDecl line=4 base=G with options { TypeLookup })
`--QualifiedLookupRequest(0x1380a8f20 ExtensionDecl line=4 base=G, {x.(file).G@/Users/spestov/src/swift/x.swift:3:8}, 'A', { NL_RemoveNonVisible, NL_RemoveOverridden, NL_OnlyTypes })
`--AccessLevelRequest(x.(file).G extension.A@/Users/spestov/src/swift/x.swift:5:13)
`--DefaultAndMaxAccessLevelRequest(extension of G@/Users/spestov/src/swift/x.swift:4:1)
`--TypeDeclsFromWhereClauseRequest(extension of G@/Users/spestov/src/swift/x.swift:4:1)
`--UnqualifiedLookupRequest(looking up 'A' from 0x1380a8f20 ExtensionDecl line=4 base=G with options { AllowProtocolMembers, TypeLookup })
`--QualifiedLookupRequest(0x1380a8f20 ExtensionDecl line=4 base=G, {x.(file).G@/Users/spestov/src/swift/x.swift:3:8}, 'A', { NL_ProtocolMembers, NL_RemoveNonVisible, NL_RemoveOverridden, NL_OnlyTypes })
`--AccessLevelRequest(x.(file).G extension.A@/Users/spestov/src/swift/x.swift:5:13) (cyclic dependency)
We should reject the reference to A
from the where
clause, I think.
Description
Very similar code (but different) to https://github.com/swiftlang/swift/issues/75711 but a different crash and backtrace
Reproduction
Stack dump
Expected behavior
To either provide a diagnostic or compile successfully
Environment
Apple Swift version 6.0-dev (LLVM 2fec3215a5e087f, Swift d4339198dcfd073) Target: arm64-apple-macosx14.0
Additional information
No response