File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -1493,6 +1493,10 @@ AssociatedTypeInference::getPotentialTypeWitnessesFromRequirement(
14931493
14941494 if (cycleCheck.checkForPotentialCycle (witness)) {
14951495 LLVM_DEBUG (llvm::dbgs () << " Skipping witness to avoid request cycle\n " );
1496+
1497+ // We must consider the possibility that none of the witnesses for this
1498+ // requirement can be chosen.
1499+ hadTautologicalWitness = true ;
14961500 continue ;
14971501 }
14981502
Original file line number Diff line number Diff line change @@ -67,8 +67,6 @@ actor A2: DistributedActor {
6767final class DA2 : DistributedActor {
6868// expected-error@-1{{non-actor type 'DA2' cannot conform to the 'AnyActor' protocol}}
6969// expected-error@-2{{non-distributed actor type 'DA2' cannot conform to the 'DistributedActor' protocol}}
70- // expected-error@-3{{'DistributedActor' requires the types 'ObjectIdentifier' and 'FakeActorSystem.ActorID' (aka 'ActorAddress') be equivalent}}
71- // expected-note@-4{{requirement specified as 'Self.ID' == 'Self.ActorSystem.ActorID' [with Self = DA2]}}
7270 nonisolated var id : ID {
7371 fatalError ( )
7472 }
Original file line number Diff line number Diff line change 1+ // RUN: %target-typecheck-verify-swift -enable-experimental-associated-type-inference
2+ // RUN: %target-typecheck-verify-swift -disable-experimental-associated-type-inference
3+
4+ public struct DefaultA { }
5+
6+ public protocol P {
7+ associatedtype A = DefaultA
8+ associatedtype B
9+
10+ static func foo( _: A , _: B )
11+ static func bar( _: B )
12+ }
13+
14+ extension P {
15+ public static func foo( _: A , _: B ) where B == Void { }
16+ }
17+
18+ // The only way C can conform to P is with 'A := DefaultA' and 'B := String'.
19+ // We skip C.foo() because it contains 'A', so we must not infer 'B := Void'
20+ // from P.foo() above.
21+ class C : P {
22+ public static func foo( _: A , _: String ) { }
23+ public static func bar( _: String ) { }
24+ }
25+
26+ let x : DefaultA . Type = C . A. self
27+ let y : String . Type = C . B. self
You can’t perform that action at this time.
0 commit comments