Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/Sema/CSSyntacticElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2212,6 +2212,8 @@ class SyntacticElementSolutionApplication

if (auto newResultTarget = rewriter.rewriteTarget(target)) {
resultExpr = newResultTarget->getAsExpr();
} else {
hadError = true;
}

switch (mode) {
Expand Down Expand Up @@ -2259,8 +2261,11 @@ class SyntacticElementSolutionApplication
}

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);

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 -> (
}
Expand Down