ff233a9ac2
Allows accessors to have different access modifiers and types Fixes #2845, #2521
32 lines
1.2 KiB
Plaintext
32 lines
1.2 KiB
Plaintext
tests/cases/compiler/accessorBodyInTypeContext.ts(2,15): error TS1183: An implementation cannot be declared in ambient contexts.
|
|
tests/cases/compiler/accessorBodyInTypeContext.ts(6,21): error TS1183: An implementation cannot be declared in ambient contexts.
|
|
tests/cases/compiler/accessorBodyInTypeContext.ts(10,15): error TS1183: An implementation cannot be declared in ambient contexts.
|
|
tests/cases/compiler/accessorBodyInTypeContext.ts(14,21): error TS1183: An implementation cannot be declared in ambient contexts.
|
|
|
|
|
|
==== tests/cases/compiler/accessorBodyInTypeContext.ts (4 errors) ====
|
|
type A = {
|
|
get foo() { return 0 }
|
|
~~~~~~~~~~~~
|
|
!!! error TS1183: An implementation cannot be declared in ambient contexts.
|
|
};
|
|
|
|
type B = {
|
|
set foo(v: any) { }
|
|
~~~
|
|
!!! error TS1183: An implementation cannot be declared in ambient contexts.
|
|
};
|
|
|
|
interface X {
|
|
get foo() { return 0 }
|
|
~~~~~~~~~~~~
|
|
!!! error TS1183: An implementation cannot be declared in ambient contexts.
|
|
}
|
|
|
|
interface Y {
|
|
set foo(v: any) { }
|
|
~~~
|
|
!!! error TS1183: An implementation cannot be declared in ambient contexts.
|
|
}
|
|
|
|
|