2015-02-04 03:02:54 +01:00
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(3,5): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
2015-01-13 19:30:32 +01:00
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(3,6): error TS2304: Cannot find name 'x'.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(4,5): error TS1021: An index signature must have a type annotation.
2015-02-04 03:02:54 +01:00
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(9,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
2015-01-13 19:30:32 +01:00
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(9,6): error TS2304: Cannot find name 'x'.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(14,5): error TS1021: An index signature must have a type annotation.
2014-09-12 22:35:07 +02:00
2015-01-13 19:30:32 +01:00
==== tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts (6 errors) ====
2014-07-13 01:04:16 +02:00
interface I {
2015-01-13 19:30:32 +01:00
// Used to be indexer, now it is a computed property
2014-07-13 01:04:16 +02:00
[x]: string;
2014-11-17 23:38:35 +01:00
~~~
2015-02-04 03:02:54 +01:00
!!! error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
2015-01-13 19:30:32 +01:00
~
!!! error TS2304: Cannot find name 'x'.
2014-07-13 01:04:16 +02:00
[x: string];
2014-11-19 03:20:41 +01:00
~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS1021: An index signature must have a type annotation.
2014-07-13 01:04:16 +02:00
}
class C {
2015-01-13 19:30:32 +01:00
// Used to be indexer, now it is a computed property
2014-07-13 01:04:16 +02:00
[x]: string
2014-11-17 23:38:35 +01:00
~~~
2015-02-04 03:02:54 +01:00
!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol.
2015-01-13 19:30:32 +01:00
~
!!! error TS2304: Cannot find name 'x'.
2014-07-13 01:04:16 +02:00
}
class C2 {
[x: string]
~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS1021: An index signature must have a type annotation.
2014-07-13 01:04:16 +02:00
}