Skip to content

Commit 3f8cd82

Browse files
committed
Update other tests and baselines
1 parent 0a985ee commit 3f8cd82

6 files changed

+15
-33
lines changed

tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(4,43): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'.
22
Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'.
3-
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,16): error TS1131: Property or signature expected.
4-
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'.
5-
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,25): error TS1128: Declaration or statement expected.
63
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,79): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ id: string; name: number; }'.
74
Types of property 'id' are incompatible.
85
Type 'number' is not assignable to type 'string'.
@@ -11,21 +8,15 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr
118
Type 'number' is not assignable to type 'boolean'.
129

1310

14-
==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts (6 errors) ====
11+
==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts (3 errors) ====
1512
var id: number = 10000;
1613
var name: string = "my name";
1714

1815
var person: { b: string; id: number } = { name, id }; // error
1916
~~~~
2017
!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'.
2118
!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ b: string; id: number; }'.
22-
var person1: { name, id }; // error: can't use short-hand property assignment in type position
23-
~~~~
24-
!!! error TS1131: Property or signature expected.
25-
~~
26-
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'.
27-
~
28-
!!! error TS1128: Declaration or statement expected.
19+
var person1: { name, id }; // ok
2920
function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error
3021
~~~~~~~~~~~~
3122
!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ id: string; name: number; }'.

tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var id: number = 10000;
33
var name: string = "my name";
44

55
var person: { b: string; id: number } = { name, id }; // error
6-
var person1: { name, id }; // error: can't use short-hand property assignment in type position
6+
var person1: { name, id }; // ok
77
function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error
88
function bar(obj: { name: string; id: boolean }) { }
99
bar({ name, id }); // error
@@ -14,8 +14,7 @@ bar({ name, id }); // error
1414
var id = 10000;
1515
var name = "my name";
1616
var person = { name: name, id: id }; // error
17-
var person1 = name, id;
18-
; // error: can't use short-hand property assignment in type position
17+
var person1; // ok
1918
function foo(name, id) { return { name: name, id: id }; } // error
2019
function bar(obj) { }
2120
bar({ name: name, id: id }); // error

tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr
33
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,79): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ name: number; id: string; }'.
44
Types of property 'name' are incompatible.
55
Type 'string' is not assignable to type 'number'.
6-
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,16): error TS1131: Property or signature expected.
7-
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'.
8-
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,25): error TS1128: Declaration or statement expected.
96
tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,5): error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'.
107
Types of property 'name' are incompatible.
118
Type 'number' is not assignable to type 'string'.
129

1310

14-
==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts (6 errors) ====
11+
==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts (3 errors) ====
1512
var id: number = 10000;
1613
var name: string = "my name";
1714

@@ -25,15 +22,10 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr
2522
!!! error TS2322: Types of property 'name' are incompatible.
2623
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2724
function foo(name: string, id: number): { name: string, id: number } { return { name, id }; } // error
28-
var person1: { name, id }; // error : Can't use shorthand in the type position
29-
~~~~
30-
!!! error TS1131: Property or signature expected.
31-
~~
32-
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'.
33-
~
34-
!!! error TS1128: Declaration or statement expected.
25+
var person1: { name, id }; // ok
3526
var person2: { name: string, id: number } = bar("hello", 5);
3627
~~~~~~~
3728
!!! error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'.
3829
!!! error TS2322: Types of property 'name' are incompatible.
39-
!!! error TS2322: Type 'number' is not assignable to type 'string'.
30+
!!! error TS2322: Type 'number' is not assignable to type 'string'.
31+

tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ var name: string = "my name";
55
var person: { b: string; id: number } = { name, id }; // error
66
function bar(name: string, id: number): { name: number, id: string } { return { name, id }; } // error
77
function foo(name: string, id: number): { name: string, id: number } { return { name, id }; } // error
8-
var person1: { name, id }; // error : Can't use shorthand in the type position
9-
var person2: { name: string, id: number } = bar("hello", 5);
8+
var person1: { name, id }; // ok
9+
var person2: { name: string, id: number } = bar("hello", 5);
10+
1011

1112
//// [objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.js]
1213
var id = 10000;
1314
var name = "my name";
1415
var person = { name: name, id: id }; // error
1516
function bar(name, id) { return { name: name, id: id }; } // error
1617
function foo(name, id) { return { name: name, id: id }; } // error
17-
var person1 = name, id;
18-
; // error : Can't use shorthand in the type position
18+
var person1; // ok
1919
var person2 = bar("hello", 5);

tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var name: string = "my name";
33

44
var person: { b: string; id: number } = { name, id }; // error
5-
var person1: { name, id }; // error: can't use short-hand property assignment in type position
5+
var person1: { name, id }; // ok
66
function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error
77
function bar(obj: { name: string; id: boolean }) { }
88
bar({ name, id }); // error

tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ var name: string = "my name";
44
var person: { b: string; id: number } = { name, id }; // error
55
function bar(name: string, id: number): { name: number, id: string } { return { name, id }; } // error
66
function foo(name: string, id: number): { name: string, id: number } { return { name, id }; } // error
7-
var person1: { name, id }; // error : Can't use shorthand in the type position
8-
var person2: { name: string, id: number } = bar("hello", 5);
7+
var person1: { name, id }; // ok
8+
var person2: { name: string, id: number } = bar("hello", 5);

0 commit comments

Comments
 (0)