Files
swift-mirror/test/Parse/super.swift
Joe Groff e6d3c3e00c Parser: Parse 'super' expressions.
Set up AST nodes for 'super.<identifier>', 'super.constructor', and 'super[<expr>]' expressions, and implement parsing for them without any sema or backend support.

Swift SVN r3847
2013-01-23 21:24:28 +00:00

33 lines
548 B
Swift

// RUN: %swift %s -dump-parse -verify
class B {
var foo : (bar:Int)
func bar() {}
constructor() {}
constructor(x:Int) {}
subscript(x:Int) -> Int {get:}
}
class D {
func super_calls() {
super.foo
super.foo.bar
super.bar
super.bar()
super.constructor
super.constructor()
super.constructor(0)
super[0]
}
func bad_super_1() {
super.$0 // expected-error{{expected identifier or 'constructor'}}
}
func bad_super_2() {
super(0) // expected-error{{expected '.' or '[' after 'super'}}
}
}