File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -743,10 +743,10 @@ ParserResult<Expr> Parser::parseExprSuper(bool isExprBasic) {
743
743
/* Implicit=*/ false ))
744
744
: cast<Expr>(new (Context) ErrorExpr (superLoc));
745
745
746
- if (Tok.is (tok::period)) {
746
+ if (Tok.isAny (tok::period, tok::period_prefix )) {
747
747
// 'super.' must be followed by a member or initializer ref.
748
748
749
- SourceLoc dotLoc = consumeToken (tok::period );
749
+ SourceLoc dotLoc = consumeToken ();
750
750
751
751
if (Tok.is (tok::code_complete)) {
752
752
if (CodeCompletion) {
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ class D : B {
26
26
let _: ( ) -> D = self . init // expected-error {{partial application of 'self.init' initializer delegation is not allowed}}
27
27
}
28
28
29
+ init ( z: Int ) {
30
+ super
31
+ . init ( x: z)
32
+ }
33
+
29
34
func super_calls( ) {
30
35
super. foo // expected-error {{expression resolves to an unused l-value}}
31
36
super. foo. bar // expected-error {{value of type 'Int' has no member 'bar'}}
@@ -35,6 +40,8 @@ class D : B {
35
40
super. init ( ) // expected-error{{'super.init' cannot be called outside of an initializer}}
36
41
super. init ( 0 ) // expected-error{{'super.init' cannot be called outside of an initializer}}
37
42
super[ 0 ] // expected-error {{expression resolves to an unused l-value}}
43
+ super
44
+ . bar ( )
38
45
}
39
46
40
47
func bad_super_1( ) {
You can’t perform that action at this time.
0 commit comments