File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed
lib/AST/RequirementMachine Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -348,13 +348,13 @@ swift::rewriting::buildTypeDifference(
348348 auto resultSymbol = [&]() {
349349 switch (symbol.getKind ()) {
350350 case Symbol::Kind::Superclass:
351- return Symbol::forSuperclass (CanType ( resultType),
351+ return Symbol::forSuperclass (resultType-> getCanonicalType ( ),
352352 resultSubstitutions, ctx);
353353 case Symbol::Kind::ConcreteType:
354- return Symbol::forConcreteType (CanType ( resultType),
354+ return Symbol::forConcreteType (resultType-> getCanonicalType ( ),
355355 resultSubstitutions, ctx);
356356 case Symbol::Kind::ConcreteConformance:
357- return Symbol::forConcreteConformance (CanType ( resultType),
357+ return Symbol::forConcreteConformance (resultType-> getCanonicalType ( ),
358358 resultSubstitutions,
359359 symbol.getProtocol (),
360360 ctx);
Original file line number Diff line number Diff line change 1+ // RUN: %target-typecheck-verify-swift -debug-generic-signatures -enable-experimental-feature TypedThrows 2>&1 | %FileCheck %s
2+
3+ protocol P1 {
4+ associatedtype A
5+ }
6+
7+ // CHECK-LABEL: typed_throws.(file).f1@
8+ // CHECK-NEXT: Generic signature: <T where T : P1, T.[P1]A == Never>
9+ func f1< T: P1 > ( _: T ) where ( ) throws ( T . A ) -> ( ) == ( ) -> ( ) { }
10+
11+ // CHECK-LABEL: typed_throws.(file).f2@
12+ // CHECK-NEXT: Generic signature: <T where T : P1, T.[P1]A == any Error>
13+ func f2< T: P1 > ( _: T ) where ( ) throws ( T . A ) -> ( ) == ( ) throws -> ( ) { }
14+
15+ protocol P2 {
16+ associatedtype A where A == ( ) throws ( E ) -> ( )
17+ associatedtype E
18+ }
19+
20+ // CHECK-LABEL: typed_throws.(file).f3@
21+ // CHECK-NEXT: Generic signature: <T where T : P2, T.[P2]E == Never>
22+ func f3< T: P2 > ( _: T ) where T. A == ( ) -> ( ) { }
23+
24+ // CHECK-LABEL: typed_throws.(file).f4@
25+ // CHECK-NEXT: Generic signature: <T where T : P2, T.[P2]E == any Error>
26+ func f4< T: P2 > ( _: T ) where T. A == ( ) throws -> ( ) { }
You can’t perform that action at this time.
0 commit comments