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

17 lines
803 B
Text
Raw Normal View History

2015-01-16 02:54:34 +01:00
tests/cases/conformance/es6/computedProperties/computedPropertyNames6.ts(6,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
tests/cases/conformance/es6/computedProperties/computedPropertyNames6.ts(7,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames6.ts (2 errors) ====
var p1: number | string;
var p2: number | number[];
var p3: string | boolean;
var v = {
[p1]: 0,
[p2]: 1,
~~~~
2015-01-16 02:54:34 +01:00
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
[p3]: 2
~~~~
2015-01-16 02:54:34 +01:00
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
}