mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CS] Fix a couple of missing error paths
Make sure we set `hadError` other we'll fail to invalidate the target.
This commit is contained in:
@@ -2212,6 +2212,8 @@ private:
|
||||
|
||||
if (auto newResultTarget = rewriter.rewriteTarget(target)) {
|
||||
resultExpr = newResultTarget->getAsExpr();
|
||||
} else {
|
||||
hadError = true;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
@@ -2259,8 +2261,11 @@ private:
|
||||
}
|
||||
|
||||
auto *resultExpr = thenStmt->getResult();
|
||||
if (auto newResultTarget = rewriter.rewriteTarget(*target))
|
||||
if (auto newResultTarget = rewriter.rewriteTarget(*target)) {
|
||||
resultExpr = newResultTarget->getAsExpr();
|
||||
} else {
|
||||
hadError = true;
|
||||
}
|
||||
|
||||
thenStmt->setResult(resultExpr);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// {"kind":"typecheck","original":"7f0c85e8","signature":"diagSyntacticUseRestrictions(swift::Expr const*, swift::DeclContext const*, bool)::DiagnoseWalker::walkToExprPre(swift::Expr*)","signatureAssert":"Assertion failed: (Ptr && \"Cannot dereference a null Type!\"), function operator->"}
|
||||
// RUN: not --crash %target-swift-frontend -typecheck %s
|
||||
// RUN: not %target-swift-frontend -typecheck %s
|
||||
class a<b, c>: ExpressibleByDictionaryLiteral {
|
||||
typealias Key = b
|
||||
typealias Value = c
|
||||
@@ -1,5 +1,5 @@
|
||||
// {"kind":"typecheck","signature":"(anonymous namespace)::ImplicitSelfUsageChecker::isClosureRequiringSelfQualification(swift::AbstractClosureExpr const*, bool)","signatureAssert":"Assertion failed: (Ptr && \"Cannot dereference a null Type!\"), function operator->"}
|
||||
// RUN: not --crash %target-swift-frontend -typecheck %s
|
||||
// RUN: not %target-swift-frontend -typecheck %s
|
||||
struct a : ExpressibleByBooleanLiteral {
|
||||
c(d : Bool -> (
|
||||
}
|
||||
Reference in New Issue
Block a user