15 lines
No EOL
486 B
Text
15 lines
No EOL
486 B
Text
==== tests/cases/compiler/ambientGetters.ts (3 errors) ====
|
|
|
|
declare class A {
|
|
get length() : number;
|
|
~
|
|
!!! '{' expected.
|
|
~~~~~~
|
|
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
|
}
|
|
|
|
declare class B {
|
|
get length() { return 0; }
|
|
~~~~~~
|
|
!!! An accessor cannot be declared in an ambient context.
|
|
} |