mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Teach getSelfTypeForContainer() that it's rude to crash when the container has no type.
Fixes 68 crashes in the compiler-crashers suite. Swift SVN r26564
This commit is contained in:
@@ -3005,9 +3005,10 @@ static Type getSelfTypeForContainer(AbstractFunctionDecl *theMethod,
|
||||
}
|
||||
}
|
||||
|
||||
// If the self type is the result of an upstream error, return it
|
||||
if (selfTy->is<ErrorType>())
|
||||
return selfTy;
|
||||
// If the self type couldn't be computed, or is the result of an
|
||||
// upstream error, return an error type.
|
||||
if (!selfTy || selfTy->is<ErrorType>())
|
||||
return ErrorType::get(dc->getASTContext());
|
||||
|
||||
// Capture the generic parameters, if requested.
|
||||
if (outerGenericParams)
|
||||
|
||||
Reference in New Issue
Block a user