Skip to content

Commit 4c0c7da

Browse files
committed
[NFC] Fixup TypeChecker::getArraySliceType To Not Return Type()
1 parent d54bbc6 commit 4c0c7da

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/Sema/CSGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2938,7 +2938,7 @@ namespace {
29382938
// Try to build the appropriate type for a variadic argument list of
29392939
// the fresh element type. If that failed, just bail out.
29402940
auto array = TypeChecker::getArraySliceType(expr->getLoc(), element);
2941-
if (!array) return element;
2941+
if (array->hasError()) return element;
29422942

29432943
// Require the operand to be convertible to the array type.
29442944
CS.addConstraint(ConstraintKind::Conversion,

lib/Sema/TypeCheckDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,7 @@ static Type validateParameterType(ParamDecl *decl) {
21012101

21022102
if (decl->isVariadic()) {
21032103
Ty = TypeChecker::getArraySliceType(decl->getStartLoc(), Ty);
2104-
if (Ty.isNull()) {
2104+
if (Ty->hasError()) {
21052105
decl->setInvalid();
21062106
return ErrorType::get(ctx);
21072107
}

lib/Sema/TypeCheckType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ Type TypeChecker::getArraySliceType(SourceLoc loc, Type elementType) {
364364
ASTContext &ctx = elementType->getASTContext();
365365
if (!ctx.getArrayDecl()) {
366366
ctx.Diags.diagnose(loc, diag::sugar_type_not_found, 0);
367-
return Type();
367+
return ErrorType::get(ctx);
368368
}
369369

370370
return ArraySliceType::get(elementType);

0 commit comments

Comments
 (0)