Skip to content

Commit

Permalink
accept baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
uhyo committed Oct 11, 2020
1 parent b15b484 commit fe80303
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 58 deletions.
Expand Up @@ -5,7 +5,7 @@ interface Show {
>x : number
}
function f({ show: showRename = v => v }: Show) {}
>f : ({ show: showRename }: Show) => void
>f : ({ show }: Show) => void
>show : any
>showRename : (x: number) => string
>v => v : (v: number) => number
Expand All @@ -32,7 +32,7 @@ interface Nested {
>nested : Show
}
function ff({ nested: nestedRename = { show: v => v } }: Nested) {}
>ff : ({ nested: nestedRename }: Nested) => void
>ff : ({ nested }: Nested) => void
>nested : any
>nestedRename : Show
>{ show: v => v } : { show: (v: number) => number; }
Expand Down
8 changes: 4 additions & 4 deletions tests/baselines/reference/declarationsAndAssignments.types
Expand Up @@ -417,7 +417,7 @@ function f13() {
}

function f14([a = 1, [b = "hello", { x, y: c = false }]]) {
>f14 : ([a, [b, { x, y: c }]]: [number, [string, { x: any; y?: boolean; }]]) => void
>f14 : ([a, [b, { x, y }]]: [number, [string, { x: any; y?: boolean; }]]) => void
>a : number
>1 : 1
>b : string
Expand All @@ -438,7 +438,7 @@ function f14([a = 1, [b = "hello", { x, y: c = false }]]) {
}
f14([2, ["abc", { x: 0, y: true }]]);
>f14([2, ["abc", { x: 0, y: true }]]) : void
>f14 : ([a, [b, { x, y: c }]]: [number, [string, { x: any; y?: boolean; }]]) => void
>f14 : ([a, [b, { x, y }]]: [number, [string, { x: any; y?: boolean; }]]) => void
>[2, ["abc", { x: 0, y: true }]] : [number, [string, { x: number; y: true; }]]
>2 : 2
>["abc", { x: 0, y: true }] : [string, { x: number; y: true; }]
Expand All @@ -451,7 +451,7 @@ f14([2, ["abc", { x: 0, y: true }]]);

f14([2, ["abc", { x: 0 }]]);
>f14([2, ["abc", { x: 0 }]]) : void
>f14 : ([a, [b, { x, y: c }]]: [number, [string, { x: any; y?: boolean; }]]) => void
>f14 : ([a, [b, { x, y }]]: [number, [string, { x: any; y?: boolean; }]]) => void
>[2, ["abc", { x: 0 }]] : [number, [string, { x: number; }]]
>2 : 2
>["abc", { x: 0 }] : [string, { x: number; }]
Expand All @@ -462,7 +462,7 @@ f14([2, ["abc", { x: 0 }]]);

f14([2, ["abc", { y: false }]]); // Error, no x
>f14([2, ["abc", { y: false }]]) : void
>f14 : ([a, [b, { x, y: c }]]: [number, [string, { x: any; y?: boolean; }]]) => void
>f14 : ([a, [b, { x, y }]]: [number, [string, { x: any; y?: boolean; }]]) => void
>[2, ["abc", { y: false }]] : [number, [string, { y: false; }]]
>2 : 2
>["abc", { y: false }] : [string, { y: false; }]
Expand Down
Expand Up @@ -402,7 +402,7 @@ d5(); // Parameter is optional as its declaration included an initializer
// Type annotations must instead be written on the top- level parameter declaration

function e1({x: number}) { } // x has type any NOT number
>e1 : ({ x: number }: { x: any; }) => void
>e1 : ({ x }: { x: any; }) => void
>x : any
>number : any

Expand Down
Expand Up @@ -402,7 +402,7 @@ d5(); // Parameter is optional as its declaration included an initializer
// Type annotations must instead be written on the top- level parameter declaration

function e1({x: number}) { } // x has type any NOT number
>e1 : ({ x: number }: { x: any; }) => void
>e1 : ({ x }: { x: any; }) => void
>x : any
>number : any

Expand Down
Expand Up @@ -376,7 +376,7 @@ d5(); // Parameter is optional as its declaration included an initializer
// Type annotations must instead be written on the top- level parameter declaration

function e1({x: number}) { } // x has type any NOT number
>e1 : ({ x: number }: { x: any; }) => void
>e1 : ({ x }: { x: any; }) => void
>x : any
>number : any

Expand Down
Expand Up @@ -7,7 +7,7 @@

// Error
function a({while}) { }
>a : ({ while: }: { while: any; }) => void
>a : ({ while }: { while: any; }) => void
>while : any
> : any

Expand Down Expand Up @@ -42,32 +42,32 @@ function a7(...a: string) { }

a({ while: 1 });
>a({ while: 1 }) : void
>a : ({ while: }: { while: any; }) => void
>a : ({ while }: { while: any; }) => void
>{ while: 1 } : { while: number; }
>while : number
>1 : 1

// No Error
function b1({public: x}) { }
>b1 : ({ public: x }: { public: any; }) => void
>b1 : ({ public }: { public: any; }) => void
>public : any
>x : any

function b2({while: y}) { }
>b2 : ({ while: y }: { while: any; }) => void
>b2 : ({ while }: { while: any; }) => void
>while : any
>y : any

b1({ public: 1 });
>b1({ public: 1 }) : void
>b1 : ({ public: x }: { public: any; }) => void
>b1 : ({ public }: { public: any; }) => void
>{ public: 1 } : { public: number; }
>public : number
>1 : 1

b2({ while: 1 });
>b2({ while: 1 }) : void
>b2 : ({ while: y }: { while: any; }) => void
>b2 : ({ while }: { while: any; }) => void
>{ while: 1 } : { while: number; }
>while : number
>1 : 1
Expand Down
6 changes: 3 additions & 3 deletions tests/baselines/reference/excessPropertyCheckWithSpread.types
@@ -1,6 +1,6 @@
=== tests/cases/compiler/excessPropertyCheckWithSpread.ts ===
declare function f({ a: number }): void
>f : ({ a: number }: { a: any; }) => void
>f : ({ a }: { a: any; }) => void
>a : any
>number : any

Expand All @@ -13,7 +13,7 @@ declare let i: I;

f({ a: 1, ...i });
>f({ a: 1, ...i }) : void
>f : ({ a: number }: { a: any; }) => void
>f : ({ a }: { a: any; }) => void
>{ a: 1, ...i } : { n: number; a: number; }
>a : number
>1 : 1
Expand All @@ -35,7 +35,7 @@ declare let r: R;

f({ a: 1, ...l, ...r });
>f({ a: 1, ...l, ...r }) : void
>f : ({ a: number }: { a: any; }) => void
>f : ({ a }: { a: any; }) => void
>{ a: 1, ...l, ...r } : { opt: string | number; a: number; }
>a : number
>1 : 1
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/objectRestParameter.types
Expand Up @@ -19,7 +19,7 @@ declare function suddenly(f: (a: { x: { z, ka }, y: string }) => void);
suddenly(({ x: a, ...rest }) => rest.y);
>suddenly(({ x: a, ...rest }) => rest.y) : any
>suddenly : (f: (a: { x: { z: any; ka: any; }; y: string; }) => void) => any
>({ x: a, ...rest }) => rest.y : ({ x: a, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
>({ x: a, ...rest }) => rest.y : ({ x, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
>x : any
>a : { z: any; ka: any; }
>rest : { y: string; }
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/objectRestParameterES5.types
Expand Up @@ -19,7 +19,7 @@ declare function suddenly(f: (a: { x: { z, ka }, y: string }) => void);
suddenly(({ x: a, ...rest }) => rest.y);
>suddenly(({ x: a, ...rest }) => rest.y) : any
>suddenly : (f: (a: { x: { z: any; ka: any; }; y: string; }) => void) => any
>({ x: a, ...rest }) => rest.y : ({ x: a, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
>({ x: a, ...rest }) => rest.y : ({ x, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
>x : any
>a : { z: any; ka: any; }
>rest : { y: string; }
Expand Down
Expand Up @@ -5,8 +5,8 @@ type F = ({a: string}) => void;
>string : any

const f = ({a: string}) => string;
>f : ({ a: string }: { a: any; }) => any
>({a: string}) => string : ({ a: string }: { a: any; }) => any
>f : ({ a }: { a: any; }) => any
>({a: string}) => string : ({ a }: { a: any; }) => any
>a : any
>string : any
>string : any
Expand Down
Expand Up @@ -5,8 +5,8 @@ type F = ({a: string}) => void;
>string : any

const f = ({a: string}) => string;
>f : ({ a: string }: { a: any; }) => any
>({a: string}) => string : ({ a: string }: { a: any; }) => any
>f : ({ a }: { a: any; }) => any
>({a: string}) => string : ({ a }: { a: any; }) => any
>a : any
>string : any
>string : any
Expand Down
Expand Up @@ -34,7 +34,7 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no
>"none" : "none"

function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) {
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void
>foo1 : ({ skills: { primary, secondary } }: Robot) => void
>skills : any
>primary : any
>primaryA : string
Expand All @@ -49,7 +49,7 @@ function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) {
>primaryA : string
}
function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) {
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void
>foo2 : ({ name, skills: { primary, secondary } }: Robot) => void
>name : any
>nameC : string
>skills : any
Expand Down Expand Up @@ -81,12 +81,12 @@ function foo3({ skills }: Robot) {

foo1(robotA);
>foo1(robotA) : void
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void
>foo1 : ({ skills: { primary, secondary } }: Robot) => void
>robotA : Robot

foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void
>foo1 : ({ skills: { primary, secondary } }: Robot) => void
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"Edger" : "Edger"
Expand All @@ -99,12 +99,12 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming"

foo2(robotA);
>foo2(robotA) : void
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void
>foo2 : ({ name, skills: { primary, secondary } }: Robot) => void
>robotA : Robot

foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void
>foo2 : ({ name, skills: { primary, secondary } }: Robot) => void
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"Edger" : "Edger"
Expand Down
Expand Up @@ -34,7 +34,7 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no
>"none" : "none"

function foo1(
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }?: Robot) => void
>foo1 : ({ skills: { primary, secondary } }?: Robot) => void
{
skills: {
>skills : any
Expand Down Expand Up @@ -67,7 +67,7 @@ function foo1(
>primaryA : string
}
function foo2(
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }?: Robot) => void
>foo2 : ({ name, skills: { primary, secondary } }?: Robot) => void
{
name: nameC = "name",
>name : any
Expand Down Expand Up @@ -126,12 +126,12 @@ function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Ro

foo1(robotA);
>foo1(robotA) : void
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }?: Robot) => void
>foo1 : ({ skills: { primary, secondary } }?: Robot) => void
>robotA : Robot

foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }?: Robot) => void
>foo1 : ({ skills: { primary, secondary } }?: Robot) => void
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"Edger" : "Edger"
Expand All @@ -144,12 +144,12 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming"

foo2(robotA);
>foo2(robotA) : void
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }?: Robot) => void
>foo2 : ({ name, skills: { primary, secondary } }?: Robot) => void
>robotA : Robot

foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }?: Robot) => void
>foo2 : ({ name, skills: { primary, secondary } }?: Robot) => void
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"Edger" : "Edger"
Expand Down
Expand Up @@ -26,7 +26,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" };
>"mowing" : "mowing"

function foo1({ name: nameA }: Robot) {
>foo1 : ({ name: nameA }: Robot) => void
>foo1 : ({ name }: Robot) => void
>name : any
>nameA : string

Expand All @@ -38,7 +38,7 @@ function foo1({ name: nameA }: Robot) {
>nameA : string
}
function foo2({ name: nameB, skill: skillB }: Robot) {
>foo2 : ({ name: nameB, skill: skillB }: Robot) => void
>foo2 : ({ name, skill }: Robot) => void
>name : any
>nameB : string
>skill : any
Expand All @@ -65,12 +65,12 @@ function foo3({ name }: Robot) {

foo1(robotA);
>foo1(robotA) : void
>foo1 : ({ name: nameA }: Robot) => void
>foo1 : ({ name }: Robot) => void
>robotA : Robot

foo1({ name: "Edger", skill: "cutting edges" });
>foo1({ name: "Edger", skill: "cutting edges" }) : void
>foo1 : ({ name: nameA }: Robot) => void
>foo1 : ({ name }: Robot) => void
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
>name : string
>"Edger" : "Edger"
Expand All @@ -79,12 +79,12 @@ foo1({ name: "Edger", skill: "cutting edges" });

foo2(robotA);
>foo2(robotA) : void
>foo2 : ({ name: nameB, skill: skillB }: Robot) => void
>foo2 : ({ name, skill }: Robot) => void
>robotA : Robot

foo2({ name: "Edger", skill: "cutting edges" });
>foo2({ name: "Edger", skill: "cutting edges" }) : void
>foo2 : ({ name: nameB, skill: skillB }: Robot) => void
>foo2 : ({ name, skill }: Robot) => void
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
>name : string
>"Edger" : "Edger"
Expand Down
Expand Up @@ -26,7 +26,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" };
>"mowing" : "mowing"

function foo1({ name: nameA = "<NoName>" }: Robot = { }) {
>foo1 : ({ name: nameA }?: Robot) => void
>foo1 : ({ name }?: Robot) => void
>name : any
>nameA : string
>"<NoName>" : "<NoName>"
Expand All @@ -40,7 +40,7 @@ function foo1({ name: nameA = "<NoName>" }: Robot = { }) {
>nameA : string
}
function foo2({ name: nameB = "<NoName>", skill: skillB = "noSkill" }: Robot = {}) {
>foo2 : ({ name: nameB, skill: skillB }?: Robot) => void
>foo2 : ({ name, skill }?: Robot) => void
>name : any
>nameB : string
>"<NoName>" : "<NoName>"
Expand Down Expand Up @@ -72,12 +72,12 @@ function foo3({ name = "<NoName>" }: Robot = {}) {

foo1(robotA);
>foo1(robotA) : void
>foo1 : ({ name: nameA }?: Robot) => void
>foo1 : ({ name }?: Robot) => void
>robotA : Robot

foo1({ name: "Edger", skill: "cutting edges" });
>foo1({ name: "Edger", skill: "cutting edges" }) : void
>foo1 : ({ name: nameA }?: Robot) => void
>foo1 : ({ name }?: Robot) => void
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
>name : string
>"Edger" : "Edger"
Expand All @@ -86,12 +86,12 @@ foo1({ name: "Edger", skill: "cutting edges" });

foo2(robotA);
>foo2(robotA) : void
>foo2 : ({ name: nameB, skill: skillB }?: Robot) => void
>foo2 : ({ name, skill }?: Robot) => void
>robotA : Robot

foo2({ name: "Edger", skill: "cutting edges" });
>foo2({ name: "Edger", skill: "cutting edges" }) : void
>foo2 : ({ name: nameB, skill: skillB }?: Robot) => void
>foo2 : ({ name, skill }?: Robot) => void
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
>name : string
>"Edger" : "Edger"
Expand Down
Expand Up @@ -13,7 +13,7 @@ import("package").then(({default: foo}) => foo(42));
>import("package") : Promise<{ default: (x: number) => string; }>
>"package" : "package"
>then : <TResult1 = { default: (x: number) => string; }, TResult2 = never>(onfulfilled?: (value: { default: (x: number) => string; }) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
>({default: foo}) => foo(42) : ({ default: foo }: { default: (x: number) => string; }) => string
>({default: foo}) => foo(42) : ({ default }: { default: (x: number) => string; }) => string
>default : any
>foo : (x: number) => string
>foo(42) : string
Expand Down

0 comments on commit fe80303

Please sign in to comment.