2015-01-13 19:30:32 +01:00
|
|
|
tests/cases/compiler/indexSignatureWithInitializer.ts(3,5): error TS1169: Computed property names are not allowed in interfaces.
|
|
|
|
tests/cases/compiler/indexSignatureWithInitializer.ts(3,6): error TS2304: Cannot find name 'x'.
|
|
|
|
tests/cases/compiler/indexSignatureWithInitializer.ts(7,5): error TS1166: Computed property names are not allowed in class property declarations.
|
|
|
|
tests/cases/compiler/indexSignatureWithInitializer.ts(7,6): error TS2304: Cannot find name 'x'.
|
2014-09-12 22:35:07 +02:00
|
|
|
|
|
|
|
|
2015-01-13 19:30:32 +01:00
|
|
|
==== tests/cases/compiler/indexSignatureWithInitializer.ts (4 errors) ====
|
|
|
|
// These used to be indexers, now they are computed properties
|
2014-07-13 01:04:16 +02:00
|
|
|
interface I {
|
|
|
|
[x = '']: string;
|
2014-11-17 23:38:35 +01:00
|
|
|
~~~~~~~~
|
2014-11-27 05:10:49 +01:00
|
|
|
!!! error TS1169: Computed property names are not allowed in interfaces.
|
2015-01-13 19:30:32 +01:00
|
|
|
~
|
|
|
|
!!! error TS2304: Cannot find name 'x'.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
class C {
|
|
|
|
[x = 0]: string
|
2014-11-17 23:38:35 +01:00
|
|
|
~~~~~~~
|
2014-11-18 23:34:04 +01:00
|
|
|
!!! error TS1166: Computed property names are not allowed in class property declarations.
|
2015-01-13 19:30:32 +01:00
|
|
|
~
|
|
|
|
!!! error TS2304: Cannot find name 'x'.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|