@@ -2026,7 +2026,7 @@ static void checkInheritedDefaultValueRestrictions(ParamDecl *PD) {
2026
2026
}
2027
2027
2028
2028
// / Check the default arguments that occur within this pattern.
2029
- static void checkDefaultArguments (TypeChecker &tc, ParameterList *params) {
2029
+ static void checkDefaultArguments (ParameterList *params) {
2030
2030
for (auto *param : *params) {
2031
2031
checkInheritedDefaultValueRestrictions (param);
2032
2032
if (!param->getDefaultValue () ||
@@ -2038,8 +2038,8 @@ static void checkDefaultArguments(TypeChecker &tc, ParameterList *params) {
2038
2038
auto *initContext = param->getDefaultArgumentInitContext ();
2039
2039
2040
2040
auto resultTy =
2041
- typeCheckParameterDefault (e, initContext, param->getType (),
2042
- /* isAutoClosure= */ param->isAutoClosure ());
2041
+ TypeChecker:: typeCheckParameterDefault (e, initContext, param->getType (),
2042
+ param->isAutoClosure ());
2043
2043
2044
2044
if (resultTy) {
2045
2045
param->setDefaultValue (e);
@@ -2658,9 +2658,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
2658
2658
2659
2659
TypeChecker::checkParameterAttributes (SD->getIndices ());
2660
2660
2661
- // FIXME: Remove TypeChecker dependency.
2662
- auto &TC = *Ctx.getLegacyGlobalTypeChecker ();
2663
- checkDefaultArguments (TC, SD->getIndices ());
2661
+ checkDefaultArguments (SD->getIndices ());
2664
2662
2665
2663
if (SD->getDeclContext ()->getSelfClassDecl ()) {
2666
2664
checkDynamicSelfType (SD, SD->getValueInterfaceType ());
@@ -3282,7 +3280,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
3282
3280
if (FD->getDeclContext ()->getSelfClassDecl ())
3283
3281
checkDynamicSelfType (FD, FD->getResultInterfaceType ());
3284
3282
3285
- checkDefaultArguments (TC, FD->getParameters ());
3283
+ checkDefaultArguments (FD->getParameters ());
3286
3284
3287
3285
// Validate 'static'/'class' on functions in extensions.
3288
3286
auto StaticSpelling = FD->getStaticSpelling ();
@@ -3342,9 +3340,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
3342
3340
if (auto *PL = EED->getParameterList ()) {
3343
3341
TypeChecker::checkParameterAttributes (PL);
3344
3342
3345
- // FIXME: Remove TypeChecker dependency.
3346
- auto &TC = *Ctx.getLegacyGlobalTypeChecker ();
3347
- checkDefaultArguments (TC, PL);
3343
+ checkDefaultArguments (PL);
3348
3344
}
3349
3345
3350
3346
auto &DE = getASTContext ().Diags ;
@@ -3608,7 +3604,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
3608
3604
TC.definedFunctions .push_back (CD);
3609
3605
}
3610
3606
3611
- checkDefaultArguments (TC, CD->getParameters ());
3607
+ checkDefaultArguments (CD->getParameters ());
3612
3608
}
3613
3609
3614
3610
void visitDestructorDecl (DestructorDecl *DD) {
0 commit comments