mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into incrementalBuildInfo
This commit is contained in:
@@ -21641,7 +21641,7 @@ namespace ts {
|
||||
if (isTupleType(restType)) {
|
||||
const associatedNames = (<TupleType>(<TypeReference>restType).target).associatedNames;
|
||||
const index = pos - paramCount;
|
||||
return associatedNames ? associatedNames[index] : restParameter.escapedName + "_" + index as __String;
|
||||
return associatedNames && associatedNames[index] || restParameter.escapedName + "_" + index as __String;
|
||||
}
|
||||
return restParameter.escapedName;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
tests/cases/compiler/getParameterNameAtPosition.ts(9,7): error TS2345: Argument of type 'Mock<[any]>' is not assignable to parameter of type 'Tester'.
|
||||
Types of parameters 'args_1' and 'done' are incompatible.
|
||||
Type '(...args: any[]) => any' is not assignable to type 'undefined'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/getParameterNameAtPosition.ts (1 errors) ====
|
||||
// Repro from #30171
|
||||
|
||||
interface Mock<Y extends any[]> extends Function {
|
||||
(...args: Y): any;
|
||||
}
|
||||
type Tester = (opts: any, done: (...args: any[]) => any) => any;
|
||||
declare function cases(tester: Tester): void;
|
||||
declare function fn<Y extends any[]>(implementation?: (...args: Y) => any): Mock<Y>;
|
||||
cases(fn(opts => { }));
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type 'Mock<[any]>' is not assignable to parameter of type 'Tester'.
|
||||
!!! error TS2345: Types of parameters 'args_1' and 'done' are incompatible.
|
||||
!!! error TS2345: Type '(...args: any[]) => any' is not assignable to type 'undefined'.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
//// [getParameterNameAtPosition.ts]
|
||||
// Repro from #30171
|
||||
|
||||
interface Mock<Y extends any[]> extends Function {
|
||||
(...args: Y): any;
|
||||
}
|
||||
type Tester = (opts: any, done: (...args: any[]) => any) => any;
|
||||
declare function cases(tester: Tester): void;
|
||||
declare function fn<Y extends any[]>(implementation?: (...args: Y) => any): Mock<Y>;
|
||||
cases(fn(opts => { }));
|
||||
|
||||
|
||||
//// [getParameterNameAtPosition.js]
|
||||
"use strict";
|
||||
// Repro from #30171
|
||||
cases(fn(function (opts) { }));
|
||||
@@ -0,0 +1,37 @@
|
||||
=== tests/cases/compiler/getParameterNameAtPosition.ts ===
|
||||
// Repro from #30171
|
||||
|
||||
interface Mock<Y extends any[]> extends Function {
|
||||
>Mock : Symbol(Mock, Decl(getParameterNameAtPosition.ts, 0, 0))
|
||||
>Y : Symbol(Y, Decl(getParameterNameAtPosition.ts, 2, 15))
|
||||
>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
||||
|
||||
(...args: Y): any;
|
||||
>args : Symbol(args, Decl(getParameterNameAtPosition.ts, 3, 5))
|
||||
>Y : Symbol(Y, Decl(getParameterNameAtPosition.ts, 2, 15))
|
||||
}
|
||||
type Tester = (opts: any, done: (...args: any[]) => any) => any;
|
||||
>Tester : Symbol(Tester, Decl(getParameterNameAtPosition.ts, 4, 1))
|
||||
>opts : Symbol(opts, Decl(getParameterNameAtPosition.ts, 5, 15))
|
||||
>done : Symbol(done, Decl(getParameterNameAtPosition.ts, 5, 25))
|
||||
>args : Symbol(args, Decl(getParameterNameAtPosition.ts, 5, 33))
|
||||
|
||||
declare function cases(tester: Tester): void;
|
||||
>cases : Symbol(cases, Decl(getParameterNameAtPosition.ts, 5, 64))
|
||||
>tester : Symbol(tester, Decl(getParameterNameAtPosition.ts, 6, 23))
|
||||
>Tester : Symbol(Tester, Decl(getParameterNameAtPosition.ts, 4, 1))
|
||||
|
||||
declare function fn<Y extends any[]>(implementation?: (...args: Y) => any): Mock<Y>;
|
||||
>fn : Symbol(fn, Decl(getParameterNameAtPosition.ts, 6, 45))
|
||||
>Y : Symbol(Y, Decl(getParameterNameAtPosition.ts, 7, 20))
|
||||
>implementation : Symbol(implementation, Decl(getParameterNameAtPosition.ts, 7, 37))
|
||||
>args : Symbol(args, Decl(getParameterNameAtPosition.ts, 7, 55))
|
||||
>Y : Symbol(Y, Decl(getParameterNameAtPosition.ts, 7, 20))
|
||||
>Mock : Symbol(Mock, Decl(getParameterNameAtPosition.ts, 0, 0))
|
||||
>Y : Symbol(Y, Decl(getParameterNameAtPosition.ts, 7, 20))
|
||||
|
||||
cases(fn(opts => { }));
|
||||
>cases : Symbol(cases, Decl(getParameterNameAtPosition.ts, 5, 64))
|
||||
>fn : Symbol(fn, Decl(getParameterNameAtPosition.ts, 6, 45))
|
||||
>opts : Symbol(opts, Decl(getParameterNameAtPosition.ts, 8, 9))
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
=== tests/cases/compiler/getParameterNameAtPosition.ts ===
|
||||
// Repro from #30171
|
||||
|
||||
interface Mock<Y extends any[]> extends Function {
|
||||
(...args: Y): any;
|
||||
>args : Y
|
||||
}
|
||||
type Tester = (opts: any, done: (...args: any[]) => any) => any;
|
||||
>Tester : Tester
|
||||
>opts : any
|
||||
>done : (...args: any[]) => any
|
||||
>args : any[]
|
||||
|
||||
declare function cases(tester: Tester): void;
|
||||
>cases : (tester: Tester) => void
|
||||
>tester : Tester
|
||||
|
||||
declare function fn<Y extends any[]>(implementation?: (...args: Y) => any): Mock<Y>;
|
||||
>fn : <Y extends any[]>(implementation?: ((...args: Y) => any) | undefined) => Mock<Y>
|
||||
>implementation : ((...args: Y) => any) | undefined
|
||||
>args : Y
|
||||
|
||||
cases(fn(opts => { }));
|
||||
>cases(fn(opts => { })) : void
|
||||
>cases : (tester: Tester) => void
|
||||
>fn(opts => { }) : Mock<[any]>
|
||||
>fn : <Y extends any[]>(implementation?: ((...args: Y) => any) | undefined) => Mock<Y>
|
||||
>opts => { } : (opts: any) => void
|
||||
>opts : any
|
||||
|
||||
@@ -623,6 +623,8 @@ node_modules/npm/lib/pack.js(177,25): error TS2339: Property 'config' does not e
|
||||
node_modules/npm/lib/pack.js(299,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'.
|
||||
node_modules/npm/lib/pack.js(300,20): error TS2345: Argument of type 'string' is not assignable to parameter of type 'never'.
|
||||
node_modules/npm/lib/pack.js(300,36): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'.
|
||||
node_modules/npm/lib/pack.js(320,7): error TS2531: Object is possibly 'null'.
|
||||
node_modules/npm/lib/pack.js(325,7): error TS2531: Object is possibly 'null'.
|
||||
node_modules/npm/lib/pack.js(333,15): error TS2531: Object is possibly 'null'.
|
||||
node_modules/npm/lib/pack.js(335,17): error TS2339: Property 'code' does not exist on type 'Error'.
|
||||
node_modules/npm/lib/pack.js(336,17): error TS2339: Property 'signal' does not exist on type 'Error'.
|
||||
@@ -944,6 +946,9 @@ node_modules/npm/test/need-npm5-update/legacy-optional-deps.js(12,21): error TS2
|
||||
node_modules/npm/test/need-npm5-update/legacy-shrinkwrap.js(2,20): error TS2307: Cannot find module 'tap'.
|
||||
node_modules/npm/test/need-npm5-update/legacy-shrinkwrap.js(6,21): error TS2307: Cannot find module 'tacks'.
|
||||
node_modules/npm/test/need-npm5-update/lifecycle-signal.js(8,20): error TS2307: Cannot find module 'tap'.
|
||||
node_modules/npm/test/need-npm5-update/lifecycle-signal.js(70,3): error TS2531: Object is possibly 'null'.
|
||||
node_modules/npm/test/need-npm5-update/lifecycle-signal.js(95,3): error TS2531: Object is possibly 'null'.
|
||||
node_modules/npm/test/need-npm5-update/lifecycle-signal.js(117,3): error TS2531: Object is possibly 'null'.
|
||||
node_modules/npm/test/need-npm5-update/move-no-clobber-dest-node-modules.js(3,20): error TS2307: Cannot find module 'tap'.
|
||||
node_modules/npm/test/need-npm5-update/move-no-clobber-dest-node-modules.js(11,48): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'string[]'.
|
||||
node_modules/npm/test/need-npm5-update/need-only-update-save-optional/update-save.js(5,18): error TS2307: Cannot find module 'npm-registry-mock'.
|
||||
@@ -1712,6 +1717,7 @@ node_modules/npm/test/tap/version-from-git.js(202,7): error TS2339: Property 'lo
|
||||
node_modules/npm/test/tap/version-from-git.js(213,7): error TS2339: Property 'load' does not exist on type 'typeof EventEmitter'.
|
||||
node_modules/npm/test/tap/version-git-not-clean.js(2,20): error TS2307: Cannot find module 'tap'.
|
||||
node_modules/npm/test/tap/version-git-not-clean.js(17,7): error TS2339: Property 'load' does not exist on type 'typeof EventEmitter'.
|
||||
node_modules/npm/test/tap/version-git-not-clean.js(28,13): error TS2531: Object is possibly 'null'.
|
||||
node_modules/npm/test/tap/version-git-not-clean.js(42,17): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'.
|
||||
node_modules/npm/test/tap/version-lifecycle.js(7,20): error TS2307: Cannot find module 'tap'.
|
||||
node_modules/npm/test/tap/version-lifecycle.js(28,7): error TS2339: Property 'load' does not exist on type 'typeof EventEmitter'.
|
||||
@@ -1726,6 +1732,8 @@ node_modules/npm/test/tap/version-no-git.js(17,7): error TS2339: Property 'load'
|
||||
node_modules/npm/test/tap/version-no-package.js(2,20): error TS2307: Cannot find module 'tap'.
|
||||
node_modules/npm/test/tap/version-no-tags.js(2,20): error TS2307: Cannot find module 'tap'.
|
||||
node_modules/npm/test/tap/version-no-tags.js(17,7): error TS2339: Property 'load' does not exist on type 'typeof EventEmitter'.
|
||||
node_modules/npm/test/tap/version-no-tags.js(23,9): error TS2531: Object is possibly 'null'.
|
||||
node_modules/npm/test/tap/version-no-tags.js(32,7): error TS2531: Object is possibly 'null'.
|
||||
node_modules/npm/test/tap/version-no-tags.js(34,13): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'.
|
||||
node_modules/npm/test/tap/version-no-tags.js(35,13): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'.
|
||||
node_modules/npm/test/tap/version-sub-directory-shrinkwrap.js(8,20): error TS2307: Cannot find module 'tap'.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
// @strict: true
|
||||
|
||||
// Repro from #30171
|
||||
|
||||
interface Mock<Y extends any[]> extends Function {
|
||||
(...args: Y): any;
|
||||
}
|
||||
type Tester = (opts: any, done: (...args: any[]) => any) => any;
|
||||
declare function cases(tester: Tester): void;
|
||||
declare function fn<Y extends any[]>(implementation?: (...args: Y) => any): Mock<Y>;
|
||||
cases(fn(opts => { }));
|
||||
Reference in New Issue
Block a user