Rename '_const' attribute to 'CompileTimeLiteral'

To pave the way for the new experimental feature which will operate on '@const' attribute and expand the scope of what's currently handled by '_const' without breaking compatibility, for now.
This commit is contained in:
Artem Chikin
2025-03-03 11:44:10 -08:00
parent f0446d0271
commit de26e960e2
39 changed files with 119 additions and 119 deletions

View File

@@ -1368,19 +1368,19 @@ RemoveReturn *RemoveReturn::create(ConstraintSystem &cs, Type resultTy,
return new (cs.getAllocator()) RemoveReturn(cs, resultTy, locator);
}
NotCompileTimeConst::NotCompileTimeConst(ConstraintSystem &cs, Type paramTy,
NotCompileTimeLiteral::NotCompileTimeLiteral(ConstraintSystem &cs, Type paramTy,
ConstraintLocator *locator):
ContextualMismatch(cs, FixKind::NotCompileTimeConst, paramTy,
ContextualMismatch(cs, FixKind::NotCompileTimeLiteral, paramTy,
cs.getASTContext().TheEmptyTupleType, locator,
FixBehavior::AlwaysWarning) {}
NotCompileTimeConst *
NotCompileTimeConst::create(ConstraintSystem &cs, Type paramTy,
NotCompileTimeLiteral *
NotCompileTimeLiteral::create(ConstraintSystem &cs, Type paramTy,
ConstraintLocator *locator) {
return new (cs.getAllocator()) NotCompileTimeConst(cs, paramTy, locator);
return new (cs.getAllocator()) NotCompileTimeLiteral(cs, paramTy, locator);
}
bool NotCompileTimeConst::diagnose(const Solution &solution, bool asNote) const {
bool NotCompileTimeLiteral::diagnose(const Solution &solution, bool asNote) const {
auto *locator = getLocator();
if (auto *E = getAsExpr(locator->getAnchor())) {
auto isAccepted = E->isSemanticallyConstExpr([&](Expr *E) {
@@ -1402,7 +1402,7 @@ bool NotCompileTimeConst::diagnose(const Solution &solution, bool asNote) const
return true;
}
NotCompileTimeConstFailure failure(solution, locator);
NotCompileTimeLiteralFailure failure(solution, locator);
return failure.diagnose(asNote);
}