Skip to content

Commit

Permalink
Added tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRosenwasser committed Apr 24, 2019
1 parent b010010 commit 60e7b5d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/cases/compiler/omitTypeTestErrors01.ts
@@ -0,0 +1,19 @@
// @declaration: true

interface Foo {
a: string;
b: number;
c: boolean;
}

export type Bar = Omit<Foo, "c">;
export type Baz = Omit<Foo, "b" | "c">;

export function getBarC(bar: Bar) {
return bar.c;
}

export function getBazB(baz: Baz) {
return baz.b;
}

19 changes: 19 additions & 0 deletions tests/cases/compiler/omitTypeTests01.ts
@@ -0,0 +1,19 @@
// @declaration: true

interface Foo {
a: string;
b: number;
c: boolean;
}

export type Bar = Omit<Foo, "c">;
export type Baz = Omit<Foo, "b" | "c">;

export function getBarA(bar: Bar) {
return bar.a;
}

export function getBazA(baz: Baz) {
return baz.a;
}

0 comments on commit 60e7b5d

Please sign in to comment.