2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts (4 errors) ====
|
|
|
|
interface I {
|
|
|
|
[x]: string;
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1022: An index signature parameter must have a type annotation.
|
2014-07-13 01:04:16 +02:00
|
|
|
[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
|
|
|
}
|
|
|
|
|
|
|
|
class C {
|
|
|
|
[x]: string
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1022: An index signature parameter must have a type annotation.
|
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
|
|
|
}
|