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

25 lines
1.5 KiB
Text
Raw Normal View History

tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts(7,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts(8,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts(9,5): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts(9,5): error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames9_ES5.ts (4 errors) ====
function f(s: string): string;
function f(n: number): number;
function f<T>(x: T): T;
function f(x): any { }
var v = {
[f("")]: 0,
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[f(0)]: 0,
~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
[f(true)]: 0
~~~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
~~~~~~~~~
!!! error TS2464: A computed property name must be of type 'string', 'number', or 'any'.
}