35 lines
1.1 KiB
Text
35 lines
1.1 KiB
Text
|
==== tests/cases/compiler/accessorsInAmbientContext.ts (8 errors) ====
|
||
|
|
||
|
declare module M {
|
||
|
class C {
|
||
|
get X() { return 1; }
|
||
|
~
|
||
|
!!! An accessor cannot be declared in an ambient context.
|
||
|
set X(v) { }
|
||
|
~
|
||
|
!!! An accessor cannot be declared in an ambient context.
|
||
|
|
||
|
static get Y() { return 1; }
|
||
|
~
|
||
|
!!! An accessor cannot be declared in an ambient context.
|
||
|
static set Y(v) { }
|
||
|
~
|
||
|
!!! An accessor cannot be declared in an ambient context.
|
||
|
}
|
||
|
}
|
||
|
|
||
|
declare class C {
|
||
|
get X() { return 1; }
|
||
|
~
|
||
|
!!! An accessor cannot be declared in an ambient context.
|
||
|
set X(v) { }
|
||
|
~
|
||
|
!!! An accessor cannot be declared in an ambient context.
|
||
|
|
||
|
static get Y() { return 1; }
|
||
|
~
|
||
|
!!! An accessor cannot be declared in an ambient context.
|
||
|
static set Y(v) { }
|
||
|
~
|
||
|
!!! An accessor cannot be declared in an ambient context.
|
||
|
}
|