@@ -247,28 +247,13 @@ void swift::bindExtensions(ModuleDecl &mod) {
247247
248248static void typeCheckDelayedFunctions (SourceFile &SF) {
249249 unsigned currentFunctionIdx = 0 ;
250- unsigned currentSynthesizedDecl = SF.LastCheckedSynthesizedDecl ;
251- do {
252- // Type check the body of each of the function in turn. Note that outside
253- // functions must be visited before nested functions for type-checking to
254- // work correctly.
255- for (unsigned n = SF.DelayedFunctions .size (); currentFunctionIdx != n;
256- ++currentFunctionIdx) {
257- auto *AFD = SF.DelayedFunctions [currentFunctionIdx];
258- assert (!AFD->getDeclContext ()->isLocalContext ());
259- (void )AFD->getTypecheckedBody ();
260- }
261250
262- // Type check synthesized functions and their bodies.
263- for (unsigned n = SF.SynthesizedDecls .size ();
264- currentSynthesizedDecl != n;
265- ++currentSynthesizedDecl) {
266- auto decl = SF.SynthesizedDecls [currentSynthesizedDecl];
267- TypeChecker::typeCheckDecl (decl);
268- }
269-
270- } while (currentFunctionIdx < SF.DelayedFunctions .size () ||
271- currentSynthesizedDecl < SF.SynthesizedDecls .size ());
251+ while (currentFunctionIdx < SF.DelayedFunctions .size ()) {
252+ auto *AFD = SF.DelayedFunctions [currentFunctionIdx];
253+ assert (!AFD->getDeclContext ()->isLocalContext ());
254+ (void ) AFD->getTypecheckedBody ();
255+ ++currentFunctionIdx;
256+ }
272257
273258 SF.DelayedFunctions .clear ();
274259}
0 commit comments