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

@@ -1922,11 +1922,11 @@ static ConstraintSystem::TypeMatchResult matchCallArguments(
}
}
if (!argument.isCompileTimeConst() && param.isCompileTimeConst()) {
if (!argument.isCompileTimeLiteral() && param.isCompileTimeLiteral()) {
auto *locator = cs.getConstraintLocator(loc);
SourceRange range;
// simplify locator so the anchor is the exact argument.
cs.recordFix(NotCompileTimeConst::create(cs, paramTy,
cs.recordFix(NotCompileTimeLiteral::create(cs, paramTy,
simplifyLocator(cs, locator, range)));
}
@@ -8295,7 +8295,7 @@ ConstraintSystem::simplifyConstructionConstraint(
auto &arg = fnType->getParams()[idx];
// We can disregard '_const', it's not applicable for tuple construction.
auto flags = arg.getParameterFlags().withCompileTimeConst(false);
auto flags = arg.getParameterFlags().withCompileTimeLiteral(false);
// We cannot handle inout for tuple construction.
if (flags.isInOut()) {
@@ -15504,7 +15504,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
case FixKind::RemoveExtraneousArguments:
case FixKind::SpecifyTypeForPlaceholder:
case FixKind::AllowAutoClosurePointerConversion:
case FixKind::NotCompileTimeConst:
case FixKind::NotCompileTimeLiteral:
case FixKind::RenameConflictingPatternVariables:
case FixKind::AllowInvalidPackElement:
case FixKind::AllowInvalidPackReference: