@@ -341,7 +341,6 @@ class FunctionSyntacticDiagnosticWalker : public ASTWalker {
341
341
// We skip out-of-place expr checking here since we've already performed it.
342
342
performSyntacticExprDiagnostics (expr, dcStack.back (), /* ctp*/ std::nullopt ,
343
343
/* isExprStmt=*/ false ,
344
- /* disableAvailabilityChecking*/ false ,
345
344
/* disableOutOfPlaceExprChecking*/ true );
346
345
347
346
if (auto closure = dyn_cast<ClosureExpr>(expr)) {
@@ -383,15 +382,14 @@ class FunctionSyntacticDiagnosticWalker : public ASTWalker {
383
382
} // end anonymous namespace
384
383
385
384
void constraints::performSyntacticDiagnosticsForTarget (
386
- const SyntacticElementTarget &target, bool isExprStmt,
387
- bool disableExprAvailabilityChecking) {
385
+ const SyntacticElementTarget &target, bool isExprStmt) {
388
386
auto *dc = target.getDeclContext ();
389
387
switch (target.kind ) {
390
388
case SyntacticElementTarget::Kind::expression: {
391
389
// First emit diagnostics for the main expression.
392
- performSyntacticExprDiagnostics (
393
- target. getAsExpr (), dc, target.getExprContextualTypePurpose (),
394
- isExprStmt, disableExprAvailabilityChecking );
390
+ performSyntacticExprDiagnostics (target. getAsExpr (), dc,
391
+ target.getExprContextualTypePurpose (),
392
+ isExprStmt );
395
393
return ;
396
394
}
397
395
@@ -400,8 +398,7 @@ void constraints::performSyntacticDiagnosticsForTarget(
400
398
401
399
// First emit diagnostics for the main expression.
402
400
performSyntacticExprDiagnostics (stmt->getTypeCheckedSequence (), dc,
403
- CTP_ForEachSequence, isExprStmt,
404
- disableExprAvailabilityChecking);
401
+ CTP_ForEachSequence, isExprStmt);
405
402
406
403
if (auto *whereExpr = stmt->getWhere ())
407
404
performSyntacticExprDiagnostics (whereExpr, dc, CTP_Condition,
@@ -544,9 +541,7 @@ TypeChecker::typeCheckTarget(SyntacticElementTarget &target,
544
541
// expression now.
545
542
if (!cs.shouldSuppressDiagnostics ()) {
546
543
bool isExprStmt = options.contains (TypeCheckExprFlags::IsExprStmt);
547
- performSyntacticDiagnosticsForTarget (
548
- *resultTarget, isExprStmt,
549
- options.contains (TypeCheckExprFlags::DisableExprAvailabilityChecking));
544
+ performSyntacticDiagnosticsForTarget (*resultTarget, isExprStmt);
550
545
}
551
546
552
547
return *resultTarget;
0 commit comments