Skip to content

Commit cd1f289

Browse files
committed
Accept new baselines
1 parent e290559 commit cd1f289

File tree

3 files changed

+158
-0
lines changed

3 files changed

+158
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//// [readonlyArraysAndTuples2.ts]
2+
type T10 = string[];
3+
type T11 = Array<string>;
4+
type T12 = readonly string[];
5+
type T13 = ReadonlyArray<string>;
6+
7+
type T20 = [number, number];
8+
type T21 = readonly [number, number];
9+
10+
declare function f1(ma: string[], ra: readonly string[], mt: [string, string], rt: readonly [string, string]): readonly [string, string];
11+
12+
declare const someDec: any;
13+
14+
class A {
15+
@someDec
16+
j: readonly string[] = [];
17+
@someDec
18+
k: readonly [string, number] = ['foo', 42];
19+
}
20+
21+
22+
//// [readonlyArraysAndTuples2.js]
23+
"use strict";
24+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
25+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
26+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
27+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
28+
return c > 3 && r && Object.defineProperty(target, key, r), r;
29+
};
30+
var __metadata = (this && this.__metadata) || function (k, v) {
31+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
32+
};
33+
var A = /** @class */ (function () {
34+
function A() {
35+
this.j = [];
36+
this.k = ['foo', 42];
37+
}
38+
__decorate([
39+
someDec,
40+
__metadata("design:type", Object)
41+
], A.prototype, "j");
42+
__decorate([
43+
someDec,
44+
__metadata("design:type", Object)
45+
], A.prototype, "k");
46+
return A;
47+
}());
48+
49+
50+
//// [readonlyArraysAndTuples2.d.ts]
51+
declare type T10 = string[];
52+
declare type T11 = Array<string>;
53+
declare type T12 = readonly string[];
54+
declare type T13 = ReadonlyArray<string>;
55+
declare type T20 = [number, number];
56+
declare type T21 = readonly [number, number];
57+
declare function f1(ma: string[], ra: readonly string[], mt: [string, string], rt: readonly [string, string]): readonly [string, string];
58+
declare const someDec: any;
59+
declare class A {
60+
j: readonly string[];
61+
k: readonly [string, number];
62+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
=== tests/cases/conformance/types/tuple/readonlyArraysAndTuples2.ts ===
2+
type T10 = string[];
3+
>T10 : Symbol(T10, Decl(readonlyArraysAndTuples2.ts, 0, 0))
4+
5+
type T11 = Array<string>;
6+
>T11 : Symbol(T11, Decl(readonlyArraysAndTuples2.ts, 0, 20))
7+
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
8+
9+
type T12 = readonly string[];
10+
>T12 : Symbol(T12, Decl(readonlyArraysAndTuples2.ts, 1, 25))
11+
12+
type T13 = ReadonlyArray<string>;
13+
>T13 : Symbol(T13, Decl(readonlyArraysAndTuples2.ts, 2, 29))
14+
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --))
15+
16+
type T20 = [number, number];
17+
>T20 : Symbol(T20, Decl(readonlyArraysAndTuples2.ts, 3, 33))
18+
19+
type T21 = readonly [number, number];
20+
>T21 : Symbol(T21, Decl(readonlyArraysAndTuples2.ts, 5, 28))
21+
22+
declare function f1(ma: string[], ra: readonly string[], mt: [string, string], rt: readonly [string, string]): readonly [string, string];
23+
>f1 : Symbol(f1, Decl(readonlyArraysAndTuples2.ts, 6, 37))
24+
>ma : Symbol(ma, Decl(readonlyArraysAndTuples2.ts, 8, 20))
25+
>ra : Symbol(ra, Decl(readonlyArraysAndTuples2.ts, 8, 33))
26+
>mt : Symbol(mt, Decl(readonlyArraysAndTuples2.ts, 8, 56))
27+
>rt : Symbol(rt, Decl(readonlyArraysAndTuples2.ts, 8, 78))
28+
29+
declare const someDec: any;
30+
>someDec : Symbol(someDec, Decl(readonlyArraysAndTuples2.ts, 10, 13))
31+
32+
class A {
33+
>A : Symbol(A, Decl(readonlyArraysAndTuples2.ts, 10, 27))
34+
35+
@someDec
36+
>someDec : Symbol(someDec, Decl(readonlyArraysAndTuples2.ts, 10, 13))
37+
38+
j: readonly string[] = [];
39+
>j : Symbol(A.j, Decl(readonlyArraysAndTuples2.ts, 12, 9))
40+
41+
@someDec
42+
>someDec : Symbol(someDec, Decl(readonlyArraysAndTuples2.ts, 10, 13))
43+
44+
k: readonly [string, number] = ['foo', 42];
45+
>k : Symbol(A.k, Decl(readonlyArraysAndTuples2.ts, 14, 28))
46+
}
47+
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
=== tests/cases/conformance/types/tuple/readonlyArraysAndTuples2.ts ===
2+
type T10 = string[];
3+
>T10 : string[]
4+
5+
type T11 = Array<string>;
6+
>T11 : string[]
7+
8+
type T12 = readonly string[];
9+
>T12 : readonly string[]
10+
11+
type T13 = ReadonlyArray<string>;
12+
>T13 : readonly string[]
13+
14+
type T20 = [number, number];
15+
>T20 : [number, number]
16+
17+
type T21 = readonly [number, number];
18+
>T21 : readonly [number, number]
19+
20+
declare function f1(ma: string[], ra: readonly string[], mt: [string, string], rt: readonly [string, string]): readonly [string, string];
21+
>f1 : (ma: string[], ra: readonly string[], mt: [string, string], rt: readonly [string, string]) => readonly [string, string]
22+
>ma : string[]
23+
>ra : readonly string[]
24+
>mt : [string, string]
25+
>rt : readonly [string, string]
26+
27+
declare const someDec: any;
28+
>someDec : any
29+
30+
class A {
31+
>A : A
32+
33+
@someDec
34+
>someDec : any
35+
36+
j: readonly string[] = [];
37+
>j : readonly string[]
38+
>[] : never[]
39+
40+
@someDec
41+
>someDec : any
42+
43+
k: readonly [string, number] = ['foo', 42];
44+
>k : readonly [string, number]
45+
>['foo', 42] : [string, number]
46+
>'foo' : "foo"
47+
>42 : 42
48+
}
49+

0 commit comments

Comments
 (0)