mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user