mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Defer analysis of large switch bodies
This presents a regression in diagnostic quality that is definitely worth it not to lie to SILGen about whether a switch is covered or not. At the same time, disable SIL’s unreachable diagnostic for ‘default’ clauses which would previously cause a warning to be emitted if the default was proven to be unreachable. This analysis is incomplete anyways and can be done by Sema in the future if we desire.
This commit is contained in:
@@ -1031,7 +1031,8 @@ void PatternMatchEmission::emitDispatch(ClauseMatrix &clauses, ArgArray args,
|
||||
} else {
|
||||
Loc = clauses[firstRow].getCasePattern()->getStartLoc();
|
||||
}
|
||||
SGF.SGM.diagnose(Loc, diag::unreachable_case, isDefault);
|
||||
if (!isDefault)
|
||||
SGF.SGM.diagnose(Loc, diag::unreachable_case);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user