Skip to content

Commit d22cb0c

Browse files
Accepted baselines.
1 parent 60962a8 commit d22cb0c

File tree

3 files changed

+175
-0
lines changed

3 files changed

+175
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//// [omitTypeHelperModifiers01.ts]
2+
type A = {
3+
a: number;
4+
b?: string;
5+
readonly c: boolean;
6+
d: unknown;
7+
};
8+
9+
type B = Omit<A, 'a'>;
10+
11+
function f(x: B) {
12+
const b = x.b;
13+
x.b = "hello";
14+
x.b = undefined;
15+
16+
const c = x.c;
17+
x.c = true;
18+
19+
const d = x.d;
20+
x.d = d;
21+
}
22+
23+
24+
//// [omitTypeHelperModifiers01.js]
25+
"use strict";
26+
function f(x) {
27+
var b = x.b;
28+
x.b = "hello";
29+
x.b = undefined;
30+
var c = x.c;
31+
x.c = true;
32+
var d = x.d;
33+
x.d = d;
34+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
=== tests/cases/compiler/omitTypeHelperModifiers01.ts ===
2+
type A = {
3+
>A : Symbol(A, Decl(omitTypeHelperModifiers01.ts, 0, 0))
4+
5+
a: number;
6+
>a : Symbol(a, Decl(omitTypeHelperModifiers01.ts, 0, 10))
7+
8+
b?: string;
9+
>b : Symbol(b, Decl(omitTypeHelperModifiers01.ts, 1, 14))
10+
11+
readonly c: boolean;
12+
>c : Symbol(c, Decl(omitTypeHelperModifiers01.ts, 2, 15))
13+
14+
d: unknown;
15+
>d : Symbol(d, Decl(omitTypeHelperModifiers01.ts, 3, 24))
16+
17+
};
18+
19+
type B = Omit<A, 'a'>;
20+
>B : Symbol(B, Decl(omitTypeHelperModifiers01.ts, 5, 2))
21+
>Omit : Symbol(Omit, Decl(lib.es5.d.ts, --, --))
22+
>A : Symbol(A, Decl(omitTypeHelperModifiers01.ts, 0, 0))
23+
24+
function f(x: B) {
25+
>f : Symbol(f, Decl(omitTypeHelperModifiers01.ts, 7, 22))
26+
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
27+
>B : Symbol(B, Decl(omitTypeHelperModifiers01.ts, 5, 2))
28+
29+
const b = x.b;
30+
>b : Symbol(b, Decl(omitTypeHelperModifiers01.ts, 10, 9))
31+
>x.b : Symbol(b)
32+
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
33+
>b : Symbol(b)
34+
35+
x.b = "hello";
36+
>x.b : Symbol(b)
37+
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
38+
>b : Symbol(b)
39+
40+
x.b = undefined;
41+
>x.b : Symbol(b)
42+
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
43+
>b : Symbol(b)
44+
>undefined : Symbol(undefined)
45+
46+
const c = x.c;
47+
>c : Symbol(c, Decl(omitTypeHelperModifiers01.ts, 14, 9))
48+
>x.c : Symbol(c)
49+
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
50+
>c : Symbol(c)
51+
52+
x.c = true;
53+
>x.c : Symbol(c)
54+
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
55+
>c : Symbol(c)
56+
57+
const d = x.d;
58+
>d : Symbol(d, Decl(omitTypeHelperModifiers01.ts, 17, 9))
59+
>x.d : Symbol(d)
60+
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
61+
>d : Symbol(d)
62+
63+
x.d = d;
64+
>x.d : Symbol(d)
65+
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
66+
>d : Symbol(d)
67+
>d : Symbol(d, Decl(omitTypeHelperModifiers01.ts, 17, 9))
68+
}
69+
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
=== tests/cases/compiler/omitTypeHelperModifiers01.ts ===
2+
type A = {
3+
>A : A
4+
5+
a: number;
6+
>a : number
7+
8+
b?: string;
9+
>b : string | undefined
10+
11+
readonly c: boolean;
12+
>c : boolean
13+
14+
d: unknown;
15+
>d : unknown
16+
17+
};
18+
19+
type B = Omit<A, 'a'>;
20+
>B : Omit<A, "a">
21+
22+
function f(x: B) {
23+
>f : (x: Omit<A, "a">) => void
24+
>x : Omit<A, "a">
25+
26+
const b = x.b;
27+
>b : string | undefined
28+
>x.b : string | undefined
29+
>x : Omit<A, "a">
30+
>b : string | undefined
31+
32+
x.b = "hello";
33+
>x.b = "hello" : "hello"
34+
>x.b : string | undefined
35+
>x : Omit<A, "a">
36+
>b : string | undefined
37+
>"hello" : "hello"
38+
39+
x.b = undefined;
40+
>x.b = undefined : undefined
41+
>x.b : string | undefined
42+
>x : Omit<A, "a">
43+
>b : string | undefined
44+
>undefined : undefined
45+
46+
const c = x.c;
47+
>c : boolean
48+
>x.c : boolean
49+
>x : Omit<A, "a">
50+
>c : boolean
51+
52+
x.c = true;
53+
>x.c = true : true
54+
>x.c : boolean
55+
>x : Omit<A, "a">
56+
>c : boolean
57+
>true : true
58+
59+
const d = x.d;
60+
>d : unknown
61+
>x.d : unknown
62+
>x : Omit<A, "a">
63+
>d : unknown
64+
65+
x.d = d;
66+
>x.d = d : unknown
67+
>x.d : unknown
68+
>x : Omit<A, "a">
69+
>d : unknown
70+
>d : unknown
71+
}
72+

0 commit comments

Comments
 (0)