Skip to content

Commit 2d37b84

Browse files
authored
Merge pull request swiftlang#35909 from slavapestov/existential-type-unsupported-trigger
Sema: Don't need to explicitly calculate existentialTypeSupported()
2 parents e3c1c42 + 92bf897 commit 2d37b84

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

lib/Sema/TypeCheckDeclPrimary.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,9 +2359,6 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
23592359
llvm::errs() << "\n";
23602360
}
23612361

2362-
// Explicitly calculate this bit.
2363-
(void) PD->existentialTypeSupported();
2364-
23652362
// Explicity compute the requirement signature to detect errors.
23662363
(void) PD->getRequirementSignature();
23672364

test/decl/protocol/conforms/circular_validation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ struct S : P { // expected-error {{type 'S' does not conform to protocol 'P'}}
1313
}
1414

1515
// FIXME: Lousy diagnostics on this case.
16-
protocol SR9224_Foo: SR9224_Foobar {} // expected-error 2 {{protocol 'SR9224_Foo' refines itself}}
17-
protocol SR9224_Bar: SR9224_Foobar {} // expected-note {{protocol 'SR9224_Bar' declared here}}
16+
protocol SR9224_Foo: SR9224_Foobar {} // expected-error {{protocol 'SR9224_Foo' refines itself}}
17+
protocol SR9224_Bar: SR9224_Foobar {}
1818
typealias SR9224_Foobar = SR9224_Foo & SR9224_Bar

test/decl/protocol/protocols.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ struct DoesNotConform : Up {
101101

102102
// Circular protocols
103103

104-
protocol CircleMiddle : CircleStart { func circle_middle() } // expected-error 2 {{protocol 'CircleMiddle' refines itself}}
105-
// expected-note@-1 {{protocol 'CircleMiddle' declared here}}
106-
protocol CircleStart : CircleEnd { func circle_start() } // expected-error {{protocol 'CircleStart' refines itself}}
107-
// expected-note@-1 2 {{protocol 'CircleStart' declared here}}
104+
protocol CircleMiddle : CircleStart { func circle_middle() } // expected-error {{protocol 'CircleMiddle' refines itself}}
105+
// expected-note@-1 2 {{protocol 'CircleMiddle' declared here}}
106+
protocol CircleStart : CircleEnd { func circle_start() } // expected-error 2 {{protocol 'CircleStart' refines itself}}
107+
// expected-note@-1 {{protocol 'CircleStart' declared here}}
108108
protocol CircleEnd : CircleMiddle { func circle_end()} // expected-note 3 {{protocol 'CircleEnd' declared here}}
109109

110110
protocol CircleEntry : CircleTrivial { }

test/type/protocol_types.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,8 @@ struct BadSubscript {
138138
set {}
139139
}
140140
}
141+
142+
struct OuterGeneric<T> {
143+
func contextuallyGenericMethod() where T == HasAssoc {}
144+
// expected-error@-1 {{protocol 'HasAssoc' can only be used as a generic constraint because it has Self or associated type requirements}}
145+
}

0 commit comments

Comments
 (0)