40 lines
887 B
Plaintext
40 lines
887 B
Plaintext
tests/cases/compiler/checkForObjectTooStrict.ts(22,19): error TS2311: A class may only extend another class.
|
|
tests/cases/compiler/checkForObjectTooStrict.ts(26,9): error TS2335: 'super' can only be referenced in a derived class.
|
|
|
|
|
|
==== tests/cases/compiler/checkForObjectTooStrict.ts (2 errors) ====
|
|
module Foo {
|
|
|
|
export class Object {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class Bar extends Foo.Object { // should work
|
|
|
|
constructor () {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
class Baz extends Object {
|
|
~~~~~~
|
|
!!! error TS2311: A class may only extend another class.
|
|
|
|
constructor () { // ERROR, as expected
|
|
|
|
super();
|
|
~~~~~
|
|
!!! error TS2335: 'super' can only be referenced in a derived class.
|
|
|
|
}
|
|
|
|
}
|
|
|