diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h index bbe61f459e781..0f86c5c2e3ee9 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -475,7 +475,7 @@ namespace swift { /// Maximum iteration count for requirement machine confluent completion /// algorithm. - unsigned RequirementMachineStepLimit = 2000; + unsigned RequirementMachineStepLimit = 4000; /// Maximum term length for requirement machine confluent completion /// algorithm. diff --git a/lib/IRGen/GenProto.cpp b/lib/IRGen/GenProto.cpp index e8e4f9dce55de..0c6489572ef40 100644 --- a/lib/IRGen/GenProto.cpp +++ b/lib/IRGen/GenProto.cpp @@ -2666,7 +2666,7 @@ MetadataResponse MetadataPath::followComponent(IRGenFunction &IGF, CanType baseSubstType = sourceConformance.getAssociatedType(sourceType, depMemType.getBase()) ->getCanonicalType(); - if (auto archetypeType = cast(baseSubstType)) { + if (auto archetypeType = dyn_cast(baseSubstType)) { AssociatedType baseAssocType(depMemType->getAssocType()); MetadataResponse response = diff --git a/test/Generics/rdar83894546_2.swift b/test/Generics/rdar83894546_2.swift new file mode 100644 index 0000000000000..a5ca524df88e2 --- /dev/null +++ b/test/Generics/rdar83894546_2.swift @@ -0,0 +1,42 @@ +// RUN: %target-typecheck-verify-swift +// RUN: %target-swift-frontend -emit-ir %s + +public struct G : P2 {} + +public protocol P1 { + associatedtype A +} + +public protocol P2: P1 where A: P7 {} + +public protocol P3 { + associatedtype B: P1 where B.A == A + associatedtype A: P7 +} + +public protocol P4: P3 where B == G { } + +public protocol P5 : P3 { + associatedtype C: P3 where C.A == A +} + +public protocol P6 : P5 where B == G, C: P4 {} + +public protocol P7 { + associatedtype D: P1 where D.A == Self +} + +public protocol P8 { + associatedtype E: P5 where E.C.B: P2 + associatedtype F: P4 where F.A == E.A +} + +public protocol P9 : P8 where E.C == F, E: P6 {} + +public func callee(_: T.Type) -> T { + fatalError() +} + +public func callee(_: T) { + _ = callee(T.F.A.D.self) +}