Sema: Move semantic constraints on super/self.init out of the parser.

Instead of forcing full application of '{super,self}.init' in the parser, and installing the RebindSelf semantic expr node early, make these constraints to Sema-time checks, and parse '<expr>.init' as a regular postfix production. This is a better separation of concerns, and also opens the door to supporting 'metatype.init()' in more general expression contexts (though that part still needs some follow-up sema work).

Swift SVN r29343
This commit is contained in:
Joe Groff
2015-06-08 04:11:16 +00:00
parent 29bacaf3ad
commit 1479a56ab3
13 changed files with 69 additions and 73 deletions

View File

@@ -2263,7 +2263,6 @@ swift::createDesignatedInitOverride(TypeChecker &tc,
superCall = new (ctx) TryExpr(SourceLoc(), superCall, Type(),
/*Implicit=*/true);
}
superCall = new (ctx) RebindSelfInConstructorExpr(superCall, selfDecl);
ctor->setBody(BraceStmt::create(tc.Context, SourceLoc(),
ASTNode(superCall),
SourceLoc(),