Skip to content

Commit

Permalink
Accepted baselines.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRosenwasser committed May 1, 2019
1 parent 60962a8 commit d22cb0c
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/baselines/reference/omitTypeHelperModifiers01.js
@@ -0,0 +1,34 @@
//// [omitTypeHelperModifiers01.ts]
type A = {
a: number;
b?: string;
readonly c: boolean;
d: unknown;
};

type B = Omit<A, 'a'>;

function f(x: B) {
const b = x.b;
x.b = "hello";
x.b = undefined;

const c = x.c;
x.c = true;

const d = x.d;
x.d = d;
}


//// [omitTypeHelperModifiers01.js]
"use strict";
function f(x) {
var b = x.b;
x.b = "hello";
x.b = undefined;
var c = x.c;
x.c = true;
var d = x.d;
x.d = d;
}
69 changes: 69 additions & 0 deletions tests/baselines/reference/omitTypeHelperModifiers01.symbols
@@ -0,0 +1,69 @@
=== tests/cases/compiler/omitTypeHelperModifiers01.ts ===
type A = {
>A : Symbol(A, Decl(omitTypeHelperModifiers01.ts, 0, 0))

a: number;
>a : Symbol(a, Decl(omitTypeHelperModifiers01.ts, 0, 10))

b?: string;
>b : Symbol(b, Decl(omitTypeHelperModifiers01.ts, 1, 14))

readonly c: boolean;
>c : Symbol(c, Decl(omitTypeHelperModifiers01.ts, 2, 15))

d: unknown;
>d : Symbol(d, Decl(omitTypeHelperModifiers01.ts, 3, 24))

};

type B = Omit<A, 'a'>;
>B : Symbol(B, Decl(omitTypeHelperModifiers01.ts, 5, 2))
>Omit : Symbol(Omit, Decl(lib.es5.d.ts, --, --))
>A : Symbol(A, Decl(omitTypeHelperModifiers01.ts, 0, 0))

function f(x: B) {
>f : Symbol(f, Decl(omitTypeHelperModifiers01.ts, 7, 22))
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
>B : Symbol(B, Decl(omitTypeHelperModifiers01.ts, 5, 2))

const b = x.b;
>b : Symbol(b, Decl(omitTypeHelperModifiers01.ts, 10, 9))
>x.b : Symbol(b)
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
>b : Symbol(b)

x.b = "hello";
>x.b : Symbol(b)
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
>b : Symbol(b)

x.b = undefined;
>x.b : Symbol(b)
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
>b : Symbol(b)
>undefined : Symbol(undefined)

const c = x.c;
>c : Symbol(c, Decl(omitTypeHelperModifiers01.ts, 14, 9))
>x.c : Symbol(c)
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
>c : Symbol(c)

x.c = true;
>x.c : Symbol(c)
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
>c : Symbol(c)

const d = x.d;
>d : Symbol(d, Decl(omitTypeHelperModifiers01.ts, 17, 9))
>x.d : Symbol(d)
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
>d : Symbol(d)

x.d = d;
>x.d : Symbol(d)
>x : Symbol(x, Decl(omitTypeHelperModifiers01.ts, 9, 11))
>d : Symbol(d)
>d : Symbol(d, Decl(omitTypeHelperModifiers01.ts, 17, 9))
}

72 changes: 72 additions & 0 deletions tests/baselines/reference/omitTypeHelperModifiers01.types
@@ -0,0 +1,72 @@
=== tests/cases/compiler/omitTypeHelperModifiers01.ts ===
type A = {
>A : A

a: number;
>a : number

b?: string;
>b : string | undefined

readonly c: boolean;
>c : boolean

d: unknown;
>d : unknown

};

type B = Omit<A, 'a'>;
>B : Omit<A, "a">

function f(x: B) {
>f : (x: Omit<A, "a">) => void
>x : Omit<A, "a">

const b = x.b;
>b : string | undefined
>x.b : string | undefined
>x : Omit<A, "a">
>b : string | undefined

x.b = "hello";
>x.b = "hello" : "hello"
>x.b : string | undefined
>x : Omit<A, "a">
>b : string | undefined
>"hello" : "hello"

x.b = undefined;
>x.b = undefined : undefined
>x.b : string | undefined
>x : Omit<A, "a">
>b : string | undefined
>undefined : undefined

const c = x.c;
>c : boolean
>x.c : boolean
>x : Omit<A, "a">
>c : boolean

x.c = true;
>x.c = true : true
>x.c : boolean
>x : Omit<A, "a">
>c : boolean
>true : true

const d = x.d;
>d : unknown
>x.d : unknown
>x : Omit<A, "a">
>d : unknown

x.d = d;
>x.d = d : unknown
>x.d : unknown
>x : Omit<A, "a">
>d : unknown
>d : unknown
}

0 comments on commit d22cb0c

Please sign in to comment.