TypeScript/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt

36 lines
1.7 KiB
Plaintext
Raw Normal View History

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.
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.
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;
~~~
!!! 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];
~~~~~~~~~~~~
!!! 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
~~~
!!! 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]
~~~~~~~~~~~
!!! error TS1021: An index signature must have a type annotation.
2014-07-13 01:04:16 +02:00
}