Accept new baselines

This commit is contained in:
Anders Hejlsberg 2019-07-11 10:47:34 -10:00
parent c53246fa35
commit 4b9ca33e1d
3 changed files with 164 additions and 0 deletions

View file

@ -0,0 +1,37 @@
//// [typeInferenceCacheInvalidation.ts]
// Repro from #32230
type Callback<TFoo, TBar> = (foo: TFoo, bar: TBar) => any
declare function example<TFoo, TBar, TCallback extends Callback<TFoo, TBar>>(
foo: TFoo,
callback: TCallback,
bar: TBar,
): TCallback
example(42, (foo, bar) => ({
t: () => {
let s: string = bar;
}
}), '42');
example(42, (foo, bar) => ({
t() {
let s: string = bar;
}
}), '42');
//// [typeInferenceCacheInvalidation.js]
"use strict";
// Repro from #32230
example(42, function (foo, bar) { return ({
t: function () {
var s = bar;
}
}); }, '42');
example(42, function (foo, bar) { return ({
t: function () {
var s = bar;
}
}); }, '42');

View file

@ -0,0 +1,64 @@
=== tests/cases/compiler/typeInferenceCacheInvalidation.ts ===
// Repro from #32230
type Callback<TFoo, TBar> = (foo: TFoo, bar: TBar) => any
>Callback : Symbol(Callback, Decl(typeInferenceCacheInvalidation.ts, 0, 0))
>TFoo : Symbol(TFoo, Decl(typeInferenceCacheInvalidation.ts, 2, 14))
>TBar : Symbol(TBar, Decl(typeInferenceCacheInvalidation.ts, 2, 19))
>foo : Symbol(foo, Decl(typeInferenceCacheInvalidation.ts, 2, 29))
>TFoo : Symbol(TFoo, Decl(typeInferenceCacheInvalidation.ts, 2, 14))
>bar : Symbol(bar, Decl(typeInferenceCacheInvalidation.ts, 2, 39))
>TBar : Symbol(TBar, Decl(typeInferenceCacheInvalidation.ts, 2, 19))
declare function example<TFoo, TBar, TCallback extends Callback<TFoo, TBar>>(
>example : Symbol(example, Decl(typeInferenceCacheInvalidation.ts, 2, 57))
>TFoo : Symbol(TFoo, Decl(typeInferenceCacheInvalidation.ts, 4, 25))
>TBar : Symbol(TBar, Decl(typeInferenceCacheInvalidation.ts, 4, 30))
>TCallback : Symbol(TCallback, Decl(typeInferenceCacheInvalidation.ts, 4, 36))
>Callback : Symbol(Callback, Decl(typeInferenceCacheInvalidation.ts, 0, 0))
>TFoo : Symbol(TFoo, Decl(typeInferenceCacheInvalidation.ts, 4, 25))
>TBar : Symbol(TBar, Decl(typeInferenceCacheInvalidation.ts, 4, 30))
foo: TFoo,
>foo : Symbol(foo, Decl(typeInferenceCacheInvalidation.ts, 4, 77))
>TFoo : Symbol(TFoo, Decl(typeInferenceCacheInvalidation.ts, 4, 25))
callback: TCallback,
>callback : Symbol(callback, Decl(typeInferenceCacheInvalidation.ts, 5, 14))
>TCallback : Symbol(TCallback, Decl(typeInferenceCacheInvalidation.ts, 4, 36))
bar: TBar,
>bar : Symbol(bar, Decl(typeInferenceCacheInvalidation.ts, 6, 24))
>TBar : Symbol(TBar, Decl(typeInferenceCacheInvalidation.ts, 4, 30))
): TCallback
>TCallback : Symbol(TCallback, Decl(typeInferenceCacheInvalidation.ts, 4, 36))
example(42, (foo, bar) => ({
>example : Symbol(example, Decl(typeInferenceCacheInvalidation.ts, 2, 57))
>foo : Symbol(foo, Decl(typeInferenceCacheInvalidation.ts, 10, 13))
>bar : Symbol(bar, Decl(typeInferenceCacheInvalidation.ts, 10, 17))
t: () => {
>t : Symbol(t, Decl(typeInferenceCacheInvalidation.ts, 10, 28))
let s: string = bar;
>s : Symbol(s, Decl(typeInferenceCacheInvalidation.ts, 12, 11))
>bar : Symbol(bar, Decl(typeInferenceCacheInvalidation.ts, 10, 17))
}
}), '42');
example(42, (foo, bar) => ({
>example : Symbol(example, Decl(typeInferenceCacheInvalidation.ts, 2, 57))
>foo : Symbol(foo, Decl(typeInferenceCacheInvalidation.ts, 16, 13))
>bar : Symbol(bar, Decl(typeInferenceCacheInvalidation.ts, 16, 17))
t() {
>t : Symbol(t, Decl(typeInferenceCacheInvalidation.ts, 16, 28))
let s: string = bar;
>s : Symbol(s, Decl(typeInferenceCacheInvalidation.ts, 18, 11))
>bar : Symbol(bar, Decl(typeInferenceCacheInvalidation.ts, 16, 17))
}
}), '42');

View file

@ -0,0 +1,63 @@
=== tests/cases/compiler/typeInferenceCacheInvalidation.ts ===
// Repro from #32230
type Callback<TFoo, TBar> = (foo: TFoo, bar: TBar) => any
>Callback : Callback<TFoo, TBar>
>foo : TFoo
>bar : TBar
declare function example<TFoo, TBar, TCallback extends Callback<TFoo, TBar>>(
>example : <TFoo, TBar, TCallback extends Callback<TFoo, TBar>>(foo: TFoo, callback: TCallback, bar: TBar) => TCallback
foo: TFoo,
>foo : TFoo
callback: TCallback,
>callback : TCallback
bar: TBar,
>bar : TBar
): TCallback
example(42, (foo, bar) => ({
>example(42, (foo, bar) => ({ t: () => { let s: string = bar; }}), '42') : (foo: number, bar: string) => { t: () => void; }
>example : <TFoo, TBar, TCallback extends Callback<TFoo, TBar>>(foo: TFoo, callback: TCallback, bar: TBar) => TCallback
>42 : 42
>(foo, bar) => ({ t: () => { let s: string = bar; }}) : (foo: number, bar: string) => { t: () => void; }
>foo : number
>bar : string
>({ t: () => { let s: string = bar; }}) : { t: () => void; }
>{ t: () => { let s: string = bar; }} : { t: () => void; }
t: () => {
>t : () => void
>() => { let s: string = bar; } : () => void
let s: string = bar;
>s : string
>bar : string
}
}), '42');
>'42' : "42"
example(42, (foo, bar) => ({
>example(42, (foo, bar) => ({ t() { let s: string = bar; }}), '42') : (foo: number, bar: string) => { t(): void; }
>example : <TFoo, TBar, TCallback extends Callback<TFoo, TBar>>(foo: TFoo, callback: TCallback, bar: TBar) => TCallback
>42 : 42
>(foo, bar) => ({ t() { let s: string = bar; }}) : (foo: number, bar: string) => { t(): void; }
>foo : number
>bar : string
>({ t() { let s: string = bar; }}) : { t(): void; }
>{ t() { let s: string = bar; }} : { t(): void; }
t() {
>t : () => void
let s: string = bar;
>s : string
>bar : string
}
}), '42');
>'42' : "42"