From 40827eb8f8ee435109fd357b68eeadbd1d41c749 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 6 Apr 2019 17:17:26 -1000 Subject: [PATCH] Accept new baselines --- .../unionAndIntersectionInference3.js | 12 +++++++++++ .../unionAndIntersectionInference3.symbols | 21 +++++++++++++++++++ .../unionAndIntersectionInference3.types | 19 +++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 tests/baselines/reference/unionAndIntersectionInference3.js create mode 100644 tests/baselines/reference/unionAndIntersectionInference3.symbols create mode 100644 tests/baselines/reference/unionAndIntersectionInference3.types diff --git a/tests/baselines/reference/unionAndIntersectionInference3.js b/tests/baselines/reference/unionAndIntersectionInference3.js new file mode 100644 index 00000000000..4cc0c2f667e --- /dev/null +++ b/tests/baselines/reference/unionAndIntersectionInference3.js @@ -0,0 +1,12 @@ +//// [unionAndIntersectionInference3.ts] +// Repro from #30720 + +type Maybe = T | undefined; +declare function concatMaybe(...args: (Maybe | Maybe[])[]): T[]; +concatMaybe([1, 2, 3], 4); + + +//// [unionAndIntersectionInference3.js] +"use strict"; +// Repro from #30720 +concatMaybe([1, 2, 3], 4); diff --git a/tests/baselines/reference/unionAndIntersectionInference3.symbols b/tests/baselines/reference/unionAndIntersectionInference3.symbols new file mode 100644 index 00000000000..be24bc0cc77 --- /dev/null +++ b/tests/baselines/reference/unionAndIntersectionInference3.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference3.ts === +// Repro from #30720 + +type Maybe = T | undefined; +>Maybe : Symbol(Maybe, Decl(unionAndIntersectionInference3.ts, 0, 0)) +>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 2, 11)) +>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 2, 11)) + +declare function concatMaybe(...args: (Maybe | Maybe[])[]): T[]; +>concatMaybe : Symbol(concatMaybe, Decl(unionAndIntersectionInference3.ts, 2, 30)) +>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 3, 29)) +>args : Symbol(args, Decl(unionAndIntersectionInference3.ts, 3, 32)) +>Maybe : Symbol(Maybe, Decl(unionAndIntersectionInference3.ts, 0, 0)) +>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 3, 29)) +>Maybe : Symbol(Maybe, Decl(unionAndIntersectionInference3.ts, 0, 0)) +>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 3, 29)) +>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 3, 29)) + +concatMaybe([1, 2, 3], 4); +>concatMaybe : Symbol(concatMaybe, Decl(unionAndIntersectionInference3.ts, 2, 30)) + diff --git a/tests/baselines/reference/unionAndIntersectionInference3.types b/tests/baselines/reference/unionAndIntersectionInference3.types new file mode 100644 index 00000000000..8497cb1e516 --- /dev/null +++ b/tests/baselines/reference/unionAndIntersectionInference3.types @@ -0,0 +1,19 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference3.ts === +// Repro from #30720 + +type Maybe = T | undefined; +>Maybe : Maybe + +declare function concatMaybe(...args: (Maybe | Maybe[])[]): T[]; +>concatMaybe : (...args: (T | Maybe[] | undefined)[]) => T[] +>args : (T | Maybe[] | undefined)[] + +concatMaybe([1, 2, 3], 4); +>concatMaybe([1, 2, 3], 4) : number[] +>concatMaybe : (...args: (T | Maybe[] | undefined)[]) => T[] +>[1, 2, 3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +