37 lines
No EOL
1.2 KiB
Text
37 lines
No EOL
1.2 KiB
Text
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (11 errors) ====
|
|
// classes cannot extend primitives
|
|
|
|
class C extends number { }
|
|
~~~~~~
|
|
!!! Cannot find name 'number'.
|
|
class C2 extends string { }
|
|
~~~~~~
|
|
!!! Cannot find name 'string'.
|
|
class C3 extends boolean { }
|
|
~~~~~~~
|
|
!!! Cannot find name 'boolean'.
|
|
class C4 extends Void { }
|
|
~~~~
|
|
!!! Cannot find name 'Void'.
|
|
class C4a extends void {}
|
|
~~~~
|
|
!!! Identifier expected.
|
|
class C5 extends Null { }
|
|
~~~~
|
|
!!! Cannot find name 'Null'.
|
|
class C5a extends null { }
|
|
~~~~
|
|
!!! Identifier expected.
|
|
~
|
|
!!! ';' expected.
|
|
class C6 extends undefined { }
|
|
~~~~~~~~~
|
|
!!! Cannot find name 'undefined'.
|
|
class C7 extends Undefined { }
|
|
~~~~~~~~~
|
|
!!! Cannot find name 'Undefined'.
|
|
|
|
enum E { A }
|
|
class C8 extends E { }
|
|
~
|
|
!!! A class may only extend another class. |