36 lines
1.6 KiB
Plaintext
36 lines
1.6 KiB
Plaintext
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(3,5): error TS1169: Computed property names are not allowed in interfaces.
|
|
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.
|
|
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(9,5): error TS1166: Computed property names are not allowed in class property declarations.
|
|
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.
|
|
|
|
|
|
==== tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts (6 errors) ====
|
|
interface I {
|
|
// Used to be indexer, now it is a computed property
|
|
[x]: string;
|
|
~~~
|
|
!!! error TS1169: Computed property names are not allowed in interfaces.
|
|
~
|
|
!!! error TS2304: Cannot find name 'x'.
|
|
[x: string];
|
|
~~~~~~~~~~~~
|
|
!!! error TS1021: An index signature must have a type annotation.
|
|
}
|
|
|
|
class C {
|
|
// Used to be indexer, now it is a computed property
|
|
[x]: string
|
|
~~~
|
|
!!! error TS1166: Computed property names are not allowed in class property declarations.
|
|
~
|
|
!!! error TS2304: Cannot find name 'x'.
|
|
|
|
}
|
|
|
|
class C2 {
|
|
[x: string]
|
|
~~~~~~~~~~~
|
|
!!! error TS1021: An index signature must have a type annotation.
|
|
} |