Skip to content

Commit 690c6c3

Browse files
authored
Merge pull request #19731 from slavapestov/stray-commits
Couple of stray fixes I forgot to check in
2 parents 7eee99a + c3f02b1 commit 690c6c3

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

lib/AST/SubstitutionMap.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,23 +108,23 @@ bool SubstitutionMap::hasAnySubstitutableParams() const {
108108
}
109109

110110
bool SubstitutionMap::hasArchetypes() const {
111-
for (Type replacementTy : getReplacementTypes()) {
111+
for (Type replacementTy : getReplacementTypesBuffer()) {
112112
if (replacementTy && replacementTy->hasArchetype())
113113
return true;
114114
}
115115
return false;
116116
}
117117

118118
bool SubstitutionMap::hasOpenedExistential() const {
119-
for (Type replacementTy : getReplacementTypes()) {
119+
for (Type replacementTy : getReplacementTypesBuffer()) {
120120
if (replacementTy && replacementTy->hasOpenedExistential())
121121
return true;
122122
}
123123
return false;
124124
}
125125

126126
bool SubstitutionMap::hasDynamicSelf() const {
127-
for (Type replacementTy : getReplacementTypes()) {
127+
for (Type replacementTy : getReplacementTypesBuffer()) {
128128
if (replacementTy && replacementTy->hasDynamicSelfType())
129129
return true;
130130
}
@@ -136,7 +136,7 @@ bool SubstitutionMap::isCanonical() const {
136136

137137
if (!getGenericSignature()->isCanonical()) return false;
138138

139-
for (Type replacementTy : getReplacementTypes()) {
139+
for (Type replacementTy : getReplacementTypesBuffer()) {
140140
if (replacementTy && !replacementTy->isCanonical())
141141
return false;
142142
}
@@ -154,7 +154,7 @@ SubstitutionMap SubstitutionMap::getCanonical() const {
154154

155155
auto canonicalSig = getGenericSignature()->getCanonicalSignature();
156156
SmallVector<Type, 4> replacementTypes;
157-
for (Type replacementType : getReplacementTypes()) {
157+
for (Type replacementType : getReplacementTypesBuffer()) {
158158
if (replacementType)
159159
replacementTypes.push_back(replacementType->getCanonicalType());
160160
else

test/decl/protocol/conforms/init.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,14 @@ class Foo : P2 {
7676
self.value = value
7777
}
7878
}
79+
80+
81+
// This used to produce a bogus diagnostic with an unknown location
82+
class Base : P1 {}
83+
// expected-error@-1 {{initializer requirement 'init()' can only be satisfied by a 'required' initializer in non-final class 'Base'}}
84+
85+
class Middle : Base {
86+
init(i: Int) {}
87+
}
88+
89+
class Derived : Middle {}

0 commit comments

Comments
 (0)