2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/inferSetterParamType.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
|
|
tests/cases/compiler/inferSetterParamType.ts(6,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
|
|
tests/cases/compiler/inferSetterParamType.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-11-05 21:26:03 +01:00
|
|
|
tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2322: Type 'number' is not assignable to type 'string'.
|
2014-12-17 00:56:56 +01:00
|
|
|
tests/cases/compiler/inferSetterParamType.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-09-12 22:35:07 +02:00
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/inferSetterParamType.ts (5 errors) ====
|
|
|
|
class Foo {
|
|
|
|
|
|
|
|
get bar() {
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
set bar(n) { // should not be an error - infer number
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class Foo2 {
|
|
|
|
|
|
|
|
get bar() {
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
return 0; // should be an error - can't coerce infered return type to match setter annotated type
|
|
|
|
~
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
set bar(n:string) {
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|