Skip to content

Couple of stray fixes I forgot to check in #19731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/AST/SubstitutionMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,23 @@ bool SubstitutionMap::hasAnySubstitutableParams() const {
}

bool SubstitutionMap::hasArchetypes() const {
for (Type replacementTy : getReplacementTypes()) {
for (Type replacementTy : getReplacementTypesBuffer()) {
if (replacementTy && replacementTy->hasArchetype())
return true;
}
return false;
}

bool SubstitutionMap::hasOpenedExistential() const {
for (Type replacementTy : getReplacementTypes()) {
for (Type replacementTy : getReplacementTypesBuffer()) {
if (replacementTy && replacementTy->hasOpenedExistential())
return true;
}
return false;
}

bool SubstitutionMap::hasDynamicSelf() const {
for (Type replacementTy : getReplacementTypes()) {
for (Type replacementTy : getReplacementTypesBuffer()) {
if (replacementTy && replacementTy->hasDynamicSelfType())
return true;
}
Expand All @@ -136,7 +136,7 @@ bool SubstitutionMap::isCanonical() const {

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

for (Type replacementTy : getReplacementTypes()) {
for (Type replacementTy : getReplacementTypesBuffer()) {
if (replacementTy && !replacementTy->isCanonical())
return false;
}
Expand All @@ -154,7 +154,7 @@ SubstitutionMap SubstitutionMap::getCanonical() const {

auto canonicalSig = getGenericSignature()->getCanonicalSignature();
SmallVector<Type, 4> replacementTypes;
for (Type replacementType : getReplacementTypes()) {
for (Type replacementType : getReplacementTypesBuffer()) {
if (replacementType)
replacementTypes.push_back(replacementType->getCanonicalType());
else
Expand Down
11 changes: 11 additions & 0 deletions test/decl/protocol/conforms/init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,14 @@ class Foo : P2 {
self.value = value
}
}


// This used to produce a bogus diagnostic with an unknown location
class Base : P1 {}
// expected-error@-1 {{initializer requirement 'init()' can only be satisfied by a 'required' initializer in non-final class 'Base'}}

class Middle : Base {
init(i: Int) {}
}

class Derived : Middle {}