@@ -453,6 +453,17 @@ static void typeCheckFunctionsAndExternalDecls(SourceFile &SF, TypeChecker &TC)
453
453
TC.typeCheckAbstractFunctionBody (AFD);
454
454
}
455
455
456
+ // Synthesize any necessary function bodies.
457
+ // FIXME: If we're not planning to run SILGen, this is wasted effort.
458
+ while (!TC.FunctionsToSynthesize .empty ()) {
459
+ auto function = TC.FunctionsToSynthesize .back ().second ;
460
+ TC.FunctionsToSynthesize .pop_back ();
461
+ if (function.getDecl ()->isInvalid () || TC.Context .hadError ())
462
+ continue ;
463
+
464
+ TC.synthesizeFunctionBody (function);
465
+ }
466
+
456
467
// Type check external definitions.
457
468
for (unsigned n = TC.Context .ExternalDefinitions .size ();
458
469
currentExternalDef != n;
@@ -483,17 +494,6 @@ static void typeCheckFunctionsAndExternalDecls(SourceFile &SF, TypeChecker &TC)
483
494
TC.validateDecl (decl);
484
495
}
485
496
486
- // Synthesize any necessary function bodies.
487
- // FIXME: If we're not planning to run SILGen, this is wasted effort.
488
- while (!TC.FunctionsToSynthesize .empty ()) {
489
- auto function = TC.FunctionsToSynthesize .back ().second ;
490
- TC.FunctionsToSynthesize .pop_back ();
491
- if (function.getDecl ()->isInvalid () || TC.Context .hadError ())
492
- continue ;
493
-
494
- TC.synthesizeFunctionBody (function);
495
- }
496
-
497
497
// Validate any referenced declarations for SIL's purposes.
498
498
// Note: if we ever start putting extension members in vtables, we'll need
499
499
// to validate those members too.
0 commit comments