AST: Correct handling of ErrorType in TypeBase::getMemberSubstitutions()

Swift SVN r30531
This commit is contained in:
Slava Pestov
2015-07-23 06:49:19 +00:00
parent 3fae9fff62
commit 0033bda331
7 changed files with 9 additions and 8 deletions

View File

@@ -2640,8 +2640,9 @@ TypeSubstitutionMap TypeBase::getMemberSubstitutions(DeclContext *dc) {
LazyResolver *resolver = dc->getASTContext().getLazyResolver();
// Find the superclass type with the context matching that of the member.
auto ownerNominal = dc->getDeclaredTypeOfContext()->getAnyNominal();
while (baseTy->getAnyNominal() != ownerNominal) {
auto ownerNominal = dc->isNominalTypeOrNominalTypeExtensionContext();
while (!baseTy->is<ErrorType>() &&
baseTy->getAnyNominal() != ownerNominal) {
baseTy = baseTy->getSuperclass(resolver);
assert(baseTy && "Couldn't find appropriate context");
}

View File

@@ -1,4 +1,4 @@
// RUN: not --crash %target-swift-frontend %s -parse
// RUN: not %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)

View File

@@ -1,4 +1,4 @@
// RUN: not --crash %target-swift-frontend %s -parse
// RUN: not %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)

View File

@@ -1,4 +1,4 @@
// RUN: not --crash %target-swift-frontend %s -parse
// RUN: not %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)

View File

@@ -1,4 +1,4 @@
// RUN: not --crash %target-swift-frontend %s -parse
// RUN: not %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)

View File

@@ -1,4 +1,4 @@
// RUN: not --crash %target-swift-frontend %s -parse
// RUN: not %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)

View File

@@ -1,4 +1,4 @@
// RUN: not --crash %target-swift-frontend %s -parse
// RUN: not %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)