mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix parameter indexing when a non-removed error param is followed by blocks.
Tested as part of the next commit. Swift SVN r28977
This commit is contained in:
@@ -227,12 +227,15 @@ AbstractionPattern::getTupleElementType(unsigned index) const {
|
||||
auto paramIndex = index;
|
||||
if (errorInfo.hasErrorParameter()) {
|
||||
auto errorParamIndex = errorInfo.getErrorParameterIndex();
|
||||
if (paramIndex == errorParamIndex &&
|
||||
errorInfo.isErrorParameterReplacedWithVoid()) {
|
||||
assert(isVoidLike(swiftEltType));
|
||||
return AbstractionPattern(swiftEltType);
|
||||
} else if (paramIndex >= errorParamIndex) {
|
||||
paramIndex++;
|
||||
if (errorInfo.isErrorParameterReplacedWithVoid()) {
|
||||
if (paramIndex == errorParamIndex) {
|
||||
assert(isVoidLike(swiftEltType));
|
||||
return AbstractionPattern(swiftEltType);
|
||||
}
|
||||
} else {
|
||||
if (paramIndex >= errorParamIndex) {
|
||||
paramIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user