mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Correct handling of ErrorType in TypeBase::getMemberSubstitutions()
Swift SVN r30531
This commit is contained in:
@@ -2640,8 +2640,9 @@ TypeSubstitutionMap TypeBase::getMemberSubstitutions(DeclContext *dc) {
|
|||||||
LazyResolver *resolver = dc->getASTContext().getLazyResolver();
|
LazyResolver *resolver = dc->getASTContext().getLazyResolver();
|
||||||
|
|
||||||
// Find the superclass type with the context matching that of the member.
|
// Find the superclass type with the context matching that of the member.
|
||||||
auto ownerNominal = dc->getDeclaredTypeOfContext()->getAnyNominal();
|
auto ownerNominal = dc->isNominalTypeOrNominalTypeExtensionContext();
|
||||||
while (baseTy->getAnyNominal() != ownerNominal) {
|
while (!baseTy->is<ErrorType>() &&
|
||||||
|
baseTy->getAnyNominal() != ownerNominal) {
|
||||||
baseTy = baseTy->getSuperclass(resolver);
|
baseTy = baseTy->getSuperclass(resolver);
|
||||||
assert(baseTy && "Couldn't find appropriate context");
|
assert(baseTy && "Couldn't find appropriate context");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
// Distributed under the terms of the MIT license
|
||||||
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
||||||
@@ -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
|
// Distributed under the terms of the MIT license
|
||||||
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
||||||
@@ -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
|
// Distributed under the terms of the MIT license
|
||||||
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
||||||
@@ -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
|
// Distributed under the terms of the MIT license
|
||||||
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
||||||
@@ -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
|
// Distributed under the terms of the MIT license
|
||||||
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
||||||
@@ -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
|
// Distributed under the terms of the MIT license
|
||||||
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
||||||
Reference in New Issue
Block a user