TypeScript/tests/baselines/reference/superErrors.errors.txt
2014-09-12 13:35:07 -07:00

102 lines
5.8 KiB
Plaintext

tests/cases/compiler/superErrors.ts(3,18): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superErrors.ts(4,24): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superErrors.ts(5,36): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superErrors.ts(31,41): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superErrors.ts(43,41): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superErrors.ts(47,22): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superErrors.ts(48,28): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superErrors.ts(49,40): error TS1034: 'super' must be followed by an argument list or member access.
tests/cases/compiler/superErrors.ts(3,13): error TS2335: 'super' can only be referenced in a derived class.
tests/cases/compiler/superErrors.ts(4,19): error TS2335: 'super' can only be referenced in a derived class.
tests/cases/compiler/superErrors.ts(5,31): error TS2335: 'super' can only be referenced in a derived class.
tests/cases/compiler/superErrors.ts(22,13): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
tests/cases/compiler/superErrors.ts(27,27): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
tests/cases/compiler/superErrors.ts(31,36): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
tests/cases/compiler/superErrors.ts(39,27): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
tests/cases/compiler/superErrors.ts(43,36): error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
==== tests/cases/compiler/superErrors.ts (16 errors) ====
function foo() {
// super in a non class context
var x = super;
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
~~~~~
!!! error TS2335: 'super' can only be referenced in a derived class.
var y = () => super;
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
~~~~~
!!! error TS2335: 'super' can only be referenced in a derived class.
var z = () => () => () => super;
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
~~~~~
!!! error TS2335: 'super' can only be referenced in a derived class.
}
class User {
name: string = "Bob";
sayHello(): void {
//console.log("Hello, " + this.name);
}
}
class RegisteredUser extends User {
name: string = "Frank";
constructor() {
super();
// super call in an inner function in a constructor
function inner() {
super.sayHello();
~~~~~
!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
}
// super call in a lambda in an inner function in a constructor
function inner2() {
var x = () => super.sayHello();
~~~~~
!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
}
// super call in a lambda in a function expression in a constructor
(function() { return () => super; })();
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
~~~~~
!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
}
sayHello(): void {
// super call in a method
super.sayHello();
// super call in a lambda in an inner function in a method
function inner() {
var x = () => super.sayHello();
~~~~~
!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
}
// super call in a lambda in a function expression in a constructor
(function() { return () => super; })();
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
~~~~~
!!! error TS2338: 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class
}
static staticFunction(): void {
// super in static functions
var s = super;
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
var x = () => super;
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
var y = () => () => () => super;
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
}
}