2014-09-12 22:35:07 +02:00
tests/cases/compiler/superInLambdas.ts(61,34): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superInLambdas.ts(65,34): error TS1034: 'super' must be followed by an argument list or member access.
2014-09-18 02:05:45 +02:00
tests/cases/compiler/superInLambdas.ts(47,49): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
tests/cases/compiler/superInLambdas.ts(51,49): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
2014-09-12 22:35:07 +02:00
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/superInLambdas.ts (4 errors) ====
class User {
name: string = "Bob";
sayHello(): void {
//console.log("Hello, " + this.name);
}
}
class RegisteredUser extends User {
name: string = "Frank";
constructor() {
super();
// super call in a constructor
super.sayHello();
// super call in a lambda in a constructor
var x = () => super.sayHello();
}
sayHello(): void {
// super call in a method
super.sayHello();
// super call in a lambda in a method
var x = () => super.sayHello();
}
}
class RegisteredUser2 extends User {
name: string = "Joe";
constructor() {
super();
// super call in a nested lambda in a constructor
var x = () => () => () => super.sayHello();
}
sayHello(): void {
// super call in a nested lambda in a method
var x = () => () => () => super.sayHello();
}
}
class RegisteredUser3 extends User {
name: string = "Sam";
constructor() {
super();
// super property in a nested lambda in a constructor
var superName = () => () => () => super.name;
~~~~
2014-09-18 02:05:45 +02:00
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
2014-07-13 01:04:16 +02:00
}
sayHello(): void {
// super property in a nested lambda in a method
var superName = () => () => () => super.name;
~~~~
2014-09-18 02:05:45 +02:00
!!! error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword
2014-07-13 01:04:16 +02:00
}
}
class RegisteredUser4 extends User {
name: string = "Mark";
constructor() {
super();
// super in a nested lambda in a constructor
var x = () => () => super;
~
2014-09-12 00:19:57 +02:00
!!! error TS1034: 'super' must be followed by an argument list or member access.
2014-07-13 01:04:16 +02:00
}
sayHello(): void {
// super in a nested lambda in a method
var x = () => () => super;
~
2014-09-12 00:19:57 +02:00
!!! error TS1034: 'super' must be followed by an argument list or member access.
2014-07-13 01:04:16 +02:00
}
}