Skip to content

Commit 9809dbc

Browse files
committed
Use IdentTypeRepr::setInvalid() rather than setting ErrorType explicitly.
Swift SVN r32419
1 parent 08d126a commit 9809dbc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,9 +1125,8 @@ Type TypeChecker::resolveIdentifierType(DeclContext *DC,
11251125
diagnose(Components.back()->getIdLoc(),
11261126
diag::note_module_as_type, moduleName);
11271127
}
1128-
Type ty = ErrorType::get(Context);
1129-
Components.back()->setValue(ty);
1130-
return ty;
1128+
Components.back()->setInvalid(Context);
1129+
return ErrorType::get(Context);
11311130
}
11321131

11331132
// We allow a type to conform to a protocol that is less available than
@@ -1144,9 +1143,8 @@ Type TypeChecker::resolveIdentifierType(DeclContext *DC,
11441143
diagnoseAvailability(result, IdType,
11451144
Components.back()->getIdLoc(), DC, *this,
11461145
AllowPotentiallyUnavailableProtocol)) {
1147-
Type ty = ErrorType::get(Context);
1148-
Components.back()->setValue(ty);
1149-
return ty;
1146+
Components.back()->setInvalid(Context);
1147+
return ErrorType::get(Context);
11501148
}
11511149

11521150
return result;

0 commit comments

Comments
 (0)