Use operator bool to claw back some readability

This commit is contained in:
Robert Widmann
2019-10-29 16:25:43 -07:00
parent 37e82a6133
commit b849e51768
45 changed files with 120 additions and 156 deletions

View File

@@ -2294,7 +2294,7 @@ bool ContextualFailure::diagnoseThrowsTypeMismatch() const {
auto conformance = TypeChecker::conformsToProtocol(
errorCodeType, errorCodeProtocol, getDC(),
ConformanceCheckFlags::InExpression);
if (!conformance.isInvalid()) {
if (conformance) {
Type errorType =
conformance
.getTypeWitnessByName(errorCodeType, getASTContext().Id_ErrorType)