diff --git a/tests/baselines/reference/taggedTemplatesWithTypeArguments1.errors.txt b/tests/baselines/reference/taggedTemplatesWithTypeArguments1.errors.txt deleted file mode 100644 index 6b732dbf4aa..00000000000 --- a/tests/baselines/reference/taggedTemplatesWithTypeArguments1.errors.txt +++ /dev/null @@ -1,84 +0,0 @@ -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(11,22): error TS2339: Property 'x' does not exist on type '{}'. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(13,22): error TS2339: Property 'y' does not exist on type '{}'. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(15,22): error TS2339: Property 'z' does not exist on type '{}'. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(24,22): error TS2339: Property 'x' does not exist on type '{}'. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(26,22): error TS2339: Property 'y' does not exist on type '{}'. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(28,22): error TS2339: Property 'z' does not exist on type '{}'. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(38,19): error TS2339: Property 'x' does not exist on type '{}'. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(39,19): error TS2339: Property 'y' does not exist on type '{}'. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(40,19): error TS2339: Property 'z' does not exist on type '{}'. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(43,19): error TS2339: Property 'x' does not exist on type '{}'. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(44,19): error TS2339: Property 'y' does not exist on type '{}'. -tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(45,19): error TS2339: Property 'z' does not exist on type '{}'. - - -==== tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts (12 errors) ==== - declare function f(strs: TemplateStringsArray, ...callbacks: Array<(x: T) => any>): void; - - interface Stuff { - x: number; - y: string; - z: boolean; - } - - export const a = f ` - hello - ${stuff => stuff.x} - ~ -!!! error TS2339: Property 'x' does not exist on type '{}'. - brave - ${stuff => stuff.y} - ~ -!!! error TS2339: Property 'y' does not exist on type '{}'. - world - ${stuff => stuff.z} - ~ -!!! error TS2339: Property 'z' does not exist on type '{}'. - `; - - declare function g( - strs: TemplateStringsArray, - t: (i: Input) => T, u: (i: Input) => U, v: (i: Input) => V): T | U | V; - - export const b = g ` - hello - ${stuff => stuff.x} - ~ -!!! error TS2339: Property 'x' does not exist on type '{}'. - brave - ${stuff => stuff.y} - ~ -!!! error TS2339: Property 'y' does not exist on type '{}'. - world - ${stuff => stuff.z} - ~ -!!! error TS2339: Property 'z' does not exist on type '{}'. - `; - - declare let obj: { - prop: (strs: TemplateStringsArray, x: (input: T) => T) => { - returnedObjProp: T - } - } - - export let c = obj["prop"] `${(input) => ({ ...input })}` - c.returnedObjProp.x; - ~ -!!! error TS2339: Property 'x' does not exist on type '{}'. - c.returnedObjProp.y; - ~ -!!! error TS2339: Property 'y' does not exist on type '{}'. - c.returnedObjProp.z; - ~ -!!! error TS2339: Property 'z' does not exist on type '{}'. - - c = obj.prop `${(input) => ({ ...input })}` - c.returnedObjProp.x; - ~ -!!! error TS2339: Property 'x' does not exist on type '{}'. - c.returnedObjProp.y; - ~ -!!! error TS2339: Property 'y' does not exist on type '{}'. - c.returnedObjProp.z; - ~ -!!! error TS2339: Property 'z' does not exist on type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithTypeArguments1.symbols b/tests/baselines/reference/taggedTemplatesWithTypeArguments1.symbols index c90089e50cc..798d2e18c68 100644 --- a/tests/baselines/reference/taggedTemplatesWithTypeArguments1.symbols +++ b/tests/baselines/reference/taggedTemplatesWithTypeArguments1.symbols @@ -30,17 +30,23 @@ export const a = f ` hello ${stuff => stuff.x} >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 10, 6)) +>stuff.x : Symbol(Stuff.x, Decl(taggedTemplatesWithTypeArguments1.ts, 2, 17)) >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 10, 6)) +>x : Symbol(Stuff.x, Decl(taggedTemplatesWithTypeArguments1.ts, 2, 17)) brave ${stuff => stuff.y} >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 12, 6)) +>stuff.y : Symbol(Stuff.y, Decl(taggedTemplatesWithTypeArguments1.ts, 3, 14)) >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 12, 6)) +>y : Symbol(Stuff.y, Decl(taggedTemplatesWithTypeArguments1.ts, 3, 14)) world ${stuff => stuff.z} >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 14, 6)) +>stuff.z : Symbol(Stuff.z, Decl(taggedTemplatesWithTypeArguments1.ts, 4, 14)) >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 14, 6)) +>z : Symbol(Stuff.z, Decl(taggedTemplatesWithTypeArguments1.ts, 4, 14)) `; @@ -80,17 +86,23 @@ export const b = g ` hello ${stuff => stuff.x} >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 23, 6)) +>stuff.x : Symbol(Stuff.x, Decl(taggedTemplatesWithTypeArguments1.ts, 2, 17)) >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 23, 6)) +>x : Symbol(Stuff.x, Decl(taggedTemplatesWithTypeArguments1.ts, 2, 17)) brave ${stuff => stuff.y} >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 25, 6)) +>stuff.y : Symbol(Stuff.y, Decl(taggedTemplatesWithTypeArguments1.ts, 3, 14)) >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 25, 6)) +>y : Symbol(Stuff.y, Decl(taggedTemplatesWithTypeArguments1.ts, 3, 14)) world ${stuff => stuff.z} >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 27, 6)) +>stuff.z : Symbol(Stuff.z, Decl(taggedTemplatesWithTypeArguments1.ts, 4, 14)) >stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 27, 6)) +>z : Symbol(Stuff.z, Decl(taggedTemplatesWithTypeArguments1.ts, 4, 14)) `; @@ -122,19 +134,25 @@ export let c = obj["prop"] `${(input) => ({ ...input })}` >input : Symbol(input, Decl(taggedTemplatesWithTypeArguments1.ts, 36, 38)) c.returnedObjProp.x; +>c.returnedObjProp.x : Symbol(Stuff.x, Decl(taggedTemplatesWithTypeArguments1.ts, 2, 17)) >c.returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) >c : Symbol(c, Decl(taggedTemplatesWithTypeArguments1.ts, 36, 10)) >returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) +>x : Symbol(Stuff.x, Decl(taggedTemplatesWithTypeArguments1.ts, 2, 17)) c.returnedObjProp.y; +>c.returnedObjProp.y : Symbol(Stuff.y, Decl(taggedTemplatesWithTypeArguments1.ts, 3, 14)) >c.returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) >c : Symbol(c, Decl(taggedTemplatesWithTypeArguments1.ts, 36, 10)) >returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) +>y : Symbol(Stuff.y, Decl(taggedTemplatesWithTypeArguments1.ts, 3, 14)) c.returnedObjProp.z; +>c.returnedObjProp.z : Symbol(Stuff.z, Decl(taggedTemplatesWithTypeArguments1.ts, 4, 14)) >c.returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) >c : Symbol(c, Decl(taggedTemplatesWithTypeArguments1.ts, 36, 10)) >returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) +>z : Symbol(Stuff.z, Decl(taggedTemplatesWithTypeArguments1.ts, 4, 14)) c = obj.prop `${(input) => ({ ...input })}` >c : Symbol(c, Decl(taggedTemplatesWithTypeArguments1.ts, 36, 10)) @@ -146,17 +164,23 @@ c = obj.prop `${(input) => ({ ...input })}` >input : Symbol(input, Decl(taggedTemplatesWithTypeArguments1.ts, 41, 24)) c.returnedObjProp.x; +>c.returnedObjProp.x : Symbol(Stuff.x, Decl(taggedTemplatesWithTypeArguments1.ts, 2, 17)) >c.returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) >c : Symbol(c, Decl(taggedTemplatesWithTypeArguments1.ts, 36, 10)) >returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) +>x : Symbol(Stuff.x, Decl(taggedTemplatesWithTypeArguments1.ts, 2, 17)) c.returnedObjProp.y; +>c.returnedObjProp.y : Symbol(Stuff.y, Decl(taggedTemplatesWithTypeArguments1.ts, 3, 14)) >c.returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) >c : Symbol(c, Decl(taggedTemplatesWithTypeArguments1.ts, 36, 10)) >returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) +>y : Symbol(Stuff.y, Decl(taggedTemplatesWithTypeArguments1.ts, 3, 14)) c.returnedObjProp.z; +>c.returnedObjProp.z : Symbol(Stuff.z, Decl(taggedTemplatesWithTypeArguments1.ts, 4, 14)) >c.returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) >c : Symbol(c, Decl(taggedTemplatesWithTypeArguments1.ts, 36, 10)) >returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66)) +>z : Symbol(Stuff.z, Decl(taggedTemplatesWithTypeArguments1.ts, 4, 14)) diff --git a/tests/baselines/reference/taggedTemplatesWithTypeArguments1.types b/tests/baselines/reference/taggedTemplatesWithTypeArguments1.types index 74f916d0efa..afa83c1b890 100644 --- a/tests/baselines/reference/taggedTemplatesWithTypeArguments1.types +++ b/tests/baselines/reference/taggedTemplatesWithTypeArguments1.types @@ -31,27 +31,27 @@ export const a = f ` hello ${stuff => stuff.x} ->stuff => stuff.x : (stuff: {}) => any ->stuff : {} ->stuff.x : any ->stuff : {} ->x : any +>stuff => stuff.x : (stuff: Stuff) => number +>stuff : Stuff +>stuff.x : number +>stuff : Stuff +>x : number brave ${stuff => stuff.y} ->stuff => stuff.y : (stuff: {}) => any ->stuff : {} ->stuff.y : any ->stuff : {} ->y : any +>stuff => stuff.y : (stuff: Stuff) => string +>stuff : Stuff +>stuff.y : string +>stuff : Stuff +>y : string world ${stuff => stuff.z} ->stuff => stuff.z : (stuff: {}) => any ->stuff : {} ->stuff.z : any ->stuff : {} ->z : any +>stuff => stuff.z : (stuff: Stuff) => boolean +>stuff : Stuff +>stuff.z : boolean +>stuff : Stuff +>z : boolean `; @@ -84,35 +84,35 @@ declare function g( >V : V export const b = g ` ->b : any ->g ` hello ${stuff => stuff.x} brave ${stuff => stuff.y} world ${stuff => stuff.z}` : any +>b : string | number | boolean +>g ` hello ${stuff => stuff.x} brave ${stuff => stuff.y} world ${stuff => stuff.z}` : string | number | boolean >g : (strs: TemplateStringsArray, t: (i: Input) => T, u: (i: Input) => U, v: (i: Input) => V) => T | U | V >Stuff : Stuff >` hello ${stuff => stuff.x} brave ${stuff => stuff.y} world ${stuff => stuff.z}` : string hello ${stuff => stuff.x} ->stuff => stuff.x : (stuff: {}) => any ->stuff : {} ->stuff.x : any ->stuff : {} ->x : any +>stuff => stuff.x : (stuff: Stuff) => number +>stuff : Stuff +>stuff.x : number +>stuff : Stuff +>x : number brave ${stuff => stuff.y} ->stuff => stuff.y : (stuff: {}) => any ->stuff : {} ->stuff.y : any ->stuff : {} ->y : any +>stuff => stuff.y : (stuff: Stuff) => string +>stuff : Stuff +>stuff.y : string +>stuff : Stuff +>y : string world ${stuff => stuff.z} ->stuff => stuff.z : (stuff: {}) => any ->stuff : {} ->stuff.z : any ->stuff : {} ->z : any +>stuff => stuff.z : (stuff: Stuff) => boolean +>stuff : Stuff +>stuff.z : boolean +>stuff : Stuff +>z : boolean `; @@ -136,73 +136,73 @@ declare let obj: { } export let c = obj["prop"] `${(input) => ({ ...input })}` ->c : { returnedObjProp: {}; } ->obj["prop"] `${(input) => ({ ...input })}` : { returnedObjProp: {}; } +>c : { returnedObjProp: Stuff; } +>obj["prop"] `${(input) => ({ ...input })}` : { returnedObjProp: Stuff; } >obj["prop"] : (strs: TemplateStringsArray, x: (input: T) => T) => { returnedObjProp: T; } >obj : { prop: (strs: TemplateStringsArray, x: (input: T) => T) => { returnedObjProp: T; }; } >"prop" : "prop" >Stuff : Stuff >`${(input) => ({ ...input })}` : string ->(input) => ({ ...input }) : (input: {}) => {} ->input : {} ->({ ...input }) : {} ->{ ...input } : {} ->input : {} +>(input) => ({ ...input }) : (input: Stuff) => { x: number; y: string; z: boolean; } +>input : Stuff +>({ ...input }) : { x: number; y: string; z: boolean; } +>{ ...input } : { x: number; y: string; z: boolean; } +>input : Stuff c.returnedObjProp.x; ->c.returnedObjProp.x : any ->c.returnedObjProp : {} ->c : { returnedObjProp: {}; } ->returnedObjProp : {} ->x : any +>c.returnedObjProp.x : number +>c.returnedObjProp : Stuff +>c : { returnedObjProp: Stuff; } +>returnedObjProp : Stuff +>x : number c.returnedObjProp.y; ->c.returnedObjProp.y : any ->c.returnedObjProp : {} ->c : { returnedObjProp: {}; } ->returnedObjProp : {} ->y : any +>c.returnedObjProp.y : string +>c.returnedObjProp : Stuff +>c : { returnedObjProp: Stuff; } +>returnedObjProp : Stuff +>y : string c.returnedObjProp.z; ->c.returnedObjProp.z : any ->c.returnedObjProp : {} ->c : { returnedObjProp: {}; } ->returnedObjProp : {} ->z : any +>c.returnedObjProp.z : boolean +>c.returnedObjProp : Stuff +>c : { returnedObjProp: Stuff; } +>returnedObjProp : Stuff +>z : boolean c = obj.prop `${(input) => ({ ...input })}` ->c = obj.prop `${(input) => ({ ...input })}` : { returnedObjProp: {}; } ->c : { returnedObjProp: {}; } ->obj.prop `${(input) => ({ ...input })}` : { returnedObjProp: {}; } +>c = obj.prop `${(input) => ({ ...input })}` : { returnedObjProp: Stuff; } +>c : { returnedObjProp: Stuff; } +>obj.prop `${(input) => ({ ...input })}` : { returnedObjProp: Stuff; } >obj.prop : (strs: TemplateStringsArray, x: (input: T) => T) => { returnedObjProp: T; } >obj : { prop: (strs: TemplateStringsArray, x: (input: T) => T) => { returnedObjProp: T; }; } >prop : (strs: TemplateStringsArray, x: (input: T) => T) => { returnedObjProp: T; } >Stuff : Stuff >`${(input) => ({ ...input })}` : string ->(input) => ({ ...input }) : (input: {}) => {} ->input : {} ->({ ...input }) : {} ->{ ...input } : {} ->input : {} +>(input) => ({ ...input }) : (input: Stuff) => { x: number; y: string; z: boolean; } +>input : Stuff +>({ ...input }) : { x: number; y: string; z: boolean; } +>{ ...input } : { x: number; y: string; z: boolean; } +>input : Stuff c.returnedObjProp.x; ->c.returnedObjProp.x : any ->c.returnedObjProp : {} ->c : { returnedObjProp: {}; } ->returnedObjProp : {} ->x : any +>c.returnedObjProp.x : number +>c.returnedObjProp : Stuff +>c : { returnedObjProp: Stuff; } +>returnedObjProp : Stuff +>x : number c.returnedObjProp.y; ->c.returnedObjProp.y : any ->c.returnedObjProp : {} ->c : { returnedObjProp: {}; } ->returnedObjProp : {} ->y : any +>c.returnedObjProp.y : string +>c.returnedObjProp : Stuff +>c : { returnedObjProp: Stuff; } +>returnedObjProp : Stuff +>y : string c.returnedObjProp.z; ->c.returnedObjProp.z : any ->c.returnedObjProp : {} ->c : { returnedObjProp: {}; } ->returnedObjProp : {} ->z : any +>c.returnedObjProp.z : boolean +>c.returnedObjProp : Stuff +>c : { returnedObjProp: Stuff; } +>returnedObjProp : Stuff +>z : boolean