diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index ae6859ad86e9c..b063de5cc1a03 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -6329,7 +6329,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (
entityName.parent.kind === SyntaxKind.TypeQuery ||
entityName.parent.kind === SyntaxKind.ExpressionWithTypeArguments && !isPartOfTypeNode(entityName.parent) ||
- entityName.parent.kind === SyntaxKind.ComputedPropertyName
+ entityName.parent.kind === SyntaxKind.ComputedPropertyName ||
+ entityName.parent.kind === SyntaxKind.TypePredicate && (entityName.parent as TypePredicateNode).parameterName === entityName
) {
// Typeof value
meaning = SymbolFlags.Value | SymbolFlags.ExportValue;
@@ -8672,6 +8673,15 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
const meaning = getMeaningOfEntityNameReference(node);
const sym = resolveEntityName(leftmost, meaning, /*ignoreErrors*/ true, /*dontResolveAlias*/ true);
if (sym) {
+ // If a parameter is resolvable in the current context it is also visible, so no need to go to symbol accesibility
+ if (
+ sym.flags & SymbolFlags.FunctionScopedVariable
+ && sym.valueDeclaration
+ ) {
+ if (isParameterDeclaration(sym.valueDeclaration)) {
+ return { introducesError, node: attachSymbolToLeftmostIdentifier(node) as T };
+ }
+ }
if (
!(sym.flags & SymbolFlags.TypeParameter) && // Type parameters are visible in the curent context if they are are resolvable
!isDeclarationName(node) &&
diff --git a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.types b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.types
index 053165a4d41e6..9aacb0c09a748 100644
--- a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.types
+++ b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.types
@@ -28,24 +28,24 @@ var out = foo((x, y) => {
> : ^^^^^^^
>foo : { (func: (x: string, y: string) => any): boolean; (func: (x: string, y: number) => any): string; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
->(x, y) => { function bar(a: typeof x): void; function bar(b: typeof y): void; function bar() { } return bar;} : (x: string, y: string) => { (a: string): void; (b: string): void; }
-> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^
+>(x, y) => { function bar(a: typeof x): void; function bar(b: typeof y): void; function bar() { } return bar;} : (x: string, y: string) => { (a: typeof x): void; (b: typeof y): void; }
+> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^ ^^^ ^^^
>x : string
> : ^^^^^^
>y : string
> : ^^^^^^
function bar(a: typeof x): void;
->bar : { (a: string): void; (b: string): void; }
-> : ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
+>bar : { (a: typeof x): void; (b: string): void; }
+> : ^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^
>a : string
> : ^^^^^^
>x : string
> : ^^^^^^
function bar(b: typeof y): void;
->bar : { (a: string): void; (b: string): void; }
-> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
+>bar : { (a: string): void; (b: typeof y): void; }
+> : ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^
>b : string
> : ^^^^^^
>y : string
@@ -88,16 +88,16 @@ var out2 = foo2((x, y) => {
> : ^^^^^^^
>foo2 : { (func: (x: string, y: string) => any): boolean; (func: (x: string, y: number) => any): string; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
->(x, y) => { var bar: { (a: typeof x): void; (b: typeof y): void; }; return bar;} : (x: string, y: string) => { (a: string): void; (b: string): void; }
-> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^
+>(x, y) => { var bar: { (a: typeof x): void; (b: typeof y): void; }; return bar;} : (x: string, y: string) => { (a: typeof x): void; (b: typeof y): void; }
+> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^ ^^^ ^^^
>x : string
> : ^^^^^^
>y : string
> : ^^^^^^
var bar: {
->bar : { (a: string): void; (b: string): void; }
-> : ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^
+>bar : { (a: typeof x): void; (b: typeof y): void; }
+> : ^^^^^^ ^^^ ^^^^^^ ^^^ ^^^
(a: typeof x): void;
>a : string
diff --git a/tests/baselines/reference/renamingDestructuredPropertyInFunctionType.js b/tests/baselines/reference/renamingDestructuredPropertyInFunctionType.js
index af19e36e72147..f24c417f4dd5c 100644
--- a/tests/baselines/reference/renamingDestructuredPropertyInFunctionType.js
+++ b/tests/baselines/reference/renamingDestructuredPropertyInFunctionType.js
@@ -171,13 +171,13 @@ interface I {
declare function f1({ a: string }: O): void;
declare const f2: ({ a: string }: O) => void;
declare const f3: ({ a: string, b, c }: O) => void;
-declare const f4: ({ a: string }: O) => string;
-declare const f5: ({ a: string, b, c }: O) => string;
+declare const f4: ({ a: string }: O) => typeof string;
+declare const f5: ({ a: string, b, c }: O) => typeof string;
declare const obj1: {
method({ a: string }: O): void;
};
declare const obj2: {
- method({ a: string }: O): string;
+ method({ a: string }: O): typeof string;
};
declare function f6({ a: string }: O): void;
declare const f7: ({ a: string, b, c }: O) => void;
diff --git a/tests/baselines/reference/renamingDestructuredPropertyInFunctionType.types b/tests/baselines/reference/renamingDestructuredPropertyInFunctionType.types
index 6e32c4f4f26a7..bc5c6edd658b7 100644
--- a/tests/baselines/reference/renamingDestructuredPropertyInFunctionType.types
+++ b/tests/baselines/reference/renamingDestructuredPropertyInFunctionType.types
@@ -325,10 +325,10 @@ const f3 = ({ a: string, b, c }: O) => { };
> : ^^^^^^
const f4 = function({ a: string }: O): typeof string { return string; };
->f4 : ({ a: string }: O) => string
-> : ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^
->function({ a: string }: O): typeof string { return string; } : ({ a: string }: O) => string
-> : ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^
+>f4 : ({ a: string }: O) => typeof string
+> : ^^^^^^^^^^^^^^^^ ^^^^^
+>function({ a: string }: O): typeof string { return string; } : ({ a: string }: O) => typeof string
+> : ^^^^^^^^^^^^^^^^ ^^^^^
>a : any
> : ^^^
>string : string
@@ -339,10 +339,10 @@ const f4 = function({ a: string }: O): typeof string { return string; };
> : ^^^^^^
const f5 = ({ a: string, b, c }: O): typeof string => '';
->f5 : ({ a: string, b, c }: O) => string
-> : ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^
->({ a: string, b, c }: O): typeof string => '' : ({ a: string, b, c }: O) => string
-> : ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^
+>f5 : ({ a: string, b, c }: O) => typeof string
+> : ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
+>({ a: string, b, c }: O): typeof string => '' : ({ a: string, b, c }: O) => typeof string
+> : ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
>a : any
> : ^^^
>string : string
@@ -372,14 +372,14 @@ const obj1 = {
};
const obj2 = {
->obj2 : { method({ a: string }: O): string; }
-> : ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
->{ method({ a: string }: O): typeof string { return string; }} : { method({ a: string }: O): string; }
-> : ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
+>obj2 : { method({ a: string }: O): typeof string; }
+> : ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^
+>{ method({ a: string }: O): typeof string { return string; }} : { method({ a: string }: O): typeof string; }
+> : ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^
method({ a: string }: O): typeof string { return string; }
->method : ({ a: string }: O) => string
-> : ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^
+>method : ({ a: string }: O) => typeof string
+> : ^^^^^^^^^^^^^^^^ ^^^^^
>a : any
> : ^^^
>string : string
diff --git a/tests/baselines/reference/subtypingWithCallSignatures.types b/tests/baselines/reference/subtypingWithCallSignatures.types
index b9832adcfd6e3..073333bd34ac4 100644
--- a/tests/baselines/reference/subtypingWithCallSignatures.types
+++ b/tests/baselines/reference/subtypingWithCallSignatures.types
@@ -6,8 +6,8 @@ module CallSignature {
> : ^^^^^^^^^^^^^^^^^^^^
declare function foo1(cb: (x: number) => void): typeof cb;
->foo1 : { (cb: (x: number) => void): (x: number) => void; (cb: any): any; }
-> : ^^^^^^^ ^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo1 : { (cb: (x: number) => void): typeof cb; (cb: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>cb : (x: number) => void
> : ^^^^ ^^^^^
>x : number
@@ -49,8 +49,8 @@ module CallSignature {
> : ^^
declare function foo2(cb: (x: number, y: number) => void): typeof cb;
->foo2 : { (cb: (x: number, y: number) => void): (x: number, y: number) => void; (cb: any): any; }
-> : ^^^^^^^ ^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo2 : { (cb: (x: number, y: number) => void): typeof cb; (cb: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>cb : (x: number, y: number) => void
> : ^^^^ ^^^^^ ^^^^^
>x : number
diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.types b/tests/baselines/reference/subtypingWithCallSignatures3.types
index 19ab69dd0b4d7..f21b0245d4842 100644
--- a/tests/baselines/reference/subtypingWithCallSignatures3.types
+++ b/tests/baselines/reference/subtypingWithCallSignatures3.types
@@ -39,8 +39,8 @@ module Errors {
> : ^^^^^^
declare function foo2(a2: (x: number) => string[]): typeof a2;
->foo2 : { (a2: (x: number) => string[]): (x: number) => string[]; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo2 : { (a2: (x: number) => string[]): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : (x: number) => string[]
> : ^^^^ ^^^^^
>x : number
@@ -54,8 +54,8 @@ module Errors {
>a2 : any
declare function foo7(a2: (x: (arg: Base) => Derived) => (r: Base) => Derived2): typeof a2;
->foo7 : { (a2: (x: (arg: Base) => Derived) => (r: Base) => Derived2): (x: (arg: Base) => Derived) => (r: Base) => Derived2; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo7 : { (a2: (x: (arg: Base) => Derived) => (r: Base) => Derived2): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : (x: (arg: Base) => Derived) => (r: Base) => Derived2
> : ^^^^ ^^^^^
>x : (arg: Base) => Derived
@@ -73,8 +73,8 @@ module Errors {
>a2 : any
declare function foo8(a2: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived): typeof a2;
->foo8 : { (a2: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived): (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo8 : { (a2: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
> : ^^^^ ^^^^^ ^^^^^
>x : (arg: Base) => Derived
@@ -96,8 +96,8 @@ module Errors {
>a2 : any
declare function foo10(a2: (...x: Base[]) => Base): typeof a2;
->foo10 : { (a2: (...x: Base[]) => Base): (...x: Base[]) => Base; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo10 : { (a2: (...x: Base[]) => Base): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : (...x: Base[]) => Base
> : ^^^^^^^ ^^^^^
>x : Base[]
@@ -111,8 +111,8 @@ module Errors {
>a2 : any
declare function foo11(a2: (x: { foo: string }, y: { foo: string; bar: string }) => Base): typeof a2;
->foo11 : { (a2: (x: { foo: string; }, y: { foo: string; bar: string; }) => Base): (x: { foo: string; }, y: { foo: string; bar: string; }) => Base; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo11 : { (a2: (x: { foo: string; }, y: { foo: string; bar: string; }) => Base): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
> : ^^^^ ^^^^^ ^^^^^
>x : { foo: string; }
@@ -134,8 +134,8 @@ module Errors {
>a2 : any
declare function foo12(a2: (x: Array, y: Array) => Array): typeof a2;
->foo12 : { (a2: (x: Array, y: Array) => Array): (x: Array, y: Array) => Array; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo12 : { (a2: (x: Array, y: Array) => Array): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : (x: Array, y: Array) => Array
> : ^^^^ ^^^^^ ^^^^^
>x : Base[]
@@ -151,8 +151,8 @@ module Errors {
>a2 : any
declare function foo15(a2: (x: { a: string; b: number }) => number): typeof a2;
->foo15 : { (a2: (x: { a: string; b: number; }) => number): (x: { a: string; b: number; }) => number; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo15 : { (a2: (x: { a: string; b: number; }) => number): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : (x: { a: string; b: number; }) => number
> : ^^^^ ^^^^^
>x : { a: string; b: number; }
@@ -170,8 +170,8 @@ module Errors {
>a2 : any
declare function foo16(a2: {
->foo16 : { (a2: { (x: { (a: number): number; (a?: number): number; }): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean; }): boolean[]; }): { (x: { (a: number): number; (a?: number): number; }): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean; }): boolean[]; }; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^ ^^^ ^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^
+>foo16 : { (a2: { (x: { (a: number): number; (a?: number): number; }): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean; }): boolean[]; }): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : { (x: { (a: number): number; (a?: number): number; }): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean; }): boolean[]; }
> : ^^^^^^ ^^^ ^^^^^^ ^^^ ^^^
@@ -212,8 +212,8 @@ module Errors {
>a2 : any
declare function foo17(a2: {
->foo17 : { (a2: { (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; }): { (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; }; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^ ^^^ ^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^
+>foo17 : { (a2: { (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; }): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : { (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; }
> : ^^^^^^ ^^^ ^^^^^^ ^^^ ^^^
@@ -748,8 +748,8 @@ module WithGenericSignaturesInBaseType {
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
declare function foo2(a2: (x: T) => T[]): typeof a2;
->foo2 : { (a2: (x: T) => T[]): (x: T) => T[]; (a2: any): any; }
-> : ^^^^^^^ ^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo2 : { (a2: (x: T) => T[]): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : (x: T) => T[]
> : ^ ^^^^^ ^^^^^
>x : T
@@ -783,8 +783,8 @@ module WithGenericSignaturesInBaseType {
> : ^^^^^^^^^^^^^^^^^^^^^
declare function foo3(a2: (x: T) => string[]): typeof a2;
->foo3 : { (a2: (x: T) => string[]): (x: T) => string[]; (a2: any): any; }
-> : ^^^^^^^ ^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo3 : { (a2: (x: T) => string[]): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : (x: T) => string[]
> : ^ ^^^^^ ^^^^^
>x : T
diff --git a/tests/baselines/reference/subtypingWithConstructSignatures.types b/tests/baselines/reference/subtypingWithConstructSignatures.types
index 80cbb2dd486d0..479558a2c5fe6 100644
--- a/tests/baselines/reference/subtypingWithConstructSignatures.types
+++ b/tests/baselines/reference/subtypingWithConstructSignatures.types
@@ -6,8 +6,8 @@ module ConstructSignature {
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
declare function foo1(cb: new (x: number) => void): typeof cb;
->foo1 : { (cb: new (x: number) => void): new (x: number) => void; (cb: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo1 : { (cb: new (x: number) => void): typeof cb; (cb: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>cb : new (x: number) => void
> : ^^^^^^^^ ^^^^^
>x : number
@@ -53,8 +53,8 @@ module ConstructSignature {
> : ^^^^^^^^^^^^^^^^^^^^^^^
declare function foo2(cb: new (x: number, y: number) => void): typeof cb;
->foo2 : { (cb: new (x: number, y: number) => void): new (x: number, y: number) => void; (cb: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo2 : { (cb: new (x: number, y: number) => void): typeof cb; (cb: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>cb : new (x: number, y: number) => void
> : ^^^^^^^^ ^^^^^ ^^^^^
>x : number
diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.types b/tests/baselines/reference/subtypingWithConstructSignatures3.types
index 3b688f80fdc23..9d7fa3649cdb9 100644
--- a/tests/baselines/reference/subtypingWithConstructSignatures3.types
+++ b/tests/baselines/reference/subtypingWithConstructSignatures3.types
@@ -39,8 +39,8 @@ module Errors {
> : ^^^^^^
declare function foo2(a2: new (x: number) => string[]): typeof a2;
->foo2 : { (a2: new (x: number) => string[]): new (x: number) => string[]; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo2 : { (a2: new (x: number) => string[]): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : new (x: number) => string[]
> : ^^^^^^^^ ^^^^^
>x : number
@@ -54,8 +54,8 @@ module Errors {
>a2 : any
declare function foo7(a2: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2): typeof a2;
->foo7 : { (a2: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2): new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo7 : { (a2: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2
> : ^^^^^^^^ ^^^^^
>x : new (arg: Base) => Derived
@@ -73,8 +73,8 @@ module Errors {
>a2 : any
declare function foo8(a2: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived): typeof a2;
->foo8 : { (a2: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived): new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo8 : { (a2: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
> : ^^^^^^^^ ^^^^^ ^^^^^
>x : new (arg: Base) => Derived
@@ -96,8 +96,8 @@ module Errors {
>a2 : any
declare function foo10(a2: new (...x: Base[]) => Base): typeof a2;
->foo10 : { (a2: new (...x: Base[]) => Base): new (...x: Base[]) => Base; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo10 : { (a2: new (...x: Base[]) => Base): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : new (...x: Base[]) => Base
> : ^^^^^^^^^^^ ^^^^^
>x : Base[]
@@ -111,8 +111,8 @@ module Errors {
>a2 : any
declare function foo11(a2: new (x: { foo: string }, y: { foo: string; bar: string }) => Base): typeof a2;
->foo11 : { (a2: new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base): new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo11 : { (a2: new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
> : ^^^^^^^^ ^^^^^ ^^^^^
>x : { foo: string; }
@@ -134,8 +134,8 @@ module Errors {
>a2 : any
declare function foo12(a2: new (x: Array, y: Array) => Array): typeof a2;
->foo12 : { (a2: new (x: Array, y: Array) => Array): new (x: Array, y: Array) => Array; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo12 : { (a2: new (x: Array, y: Array) => Array): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : new (x: Array, y: Array) => Array
> : ^^^^^^^^ ^^^^^ ^^^^^
>x : Base[]
@@ -151,8 +151,8 @@ module Errors {
>a2 : any
declare function foo15(a2: new (x: { a: string; b: number }) => number): typeof a2;
->foo15 : { (a2: new (x: { a: string; b: number; }) => number): new (x: { a: string; b: number; }) => number; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo15 : { (a2: new (x: { a: string; b: number; }) => number): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : new (x: { a: string; b: number; }) => number
> : ^^^^^^^^ ^^^^^
>x : { a: string; b: number; }
@@ -170,8 +170,8 @@ module Errors {
>a2 : any
declare function foo16(a2: {
->foo16 : { (a2: { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }): { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^
+>foo16 : { (a2: { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }
> : ^^^^^^^^^^ ^^^ ^^^^^^^^^^ ^^^ ^^^
@@ -212,8 +212,8 @@ module Errors {
>a2 : any
declare function foo17(a2: {
->foo17 : { (a2: { new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }): { new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^
+>foo17 : { (a2: { new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : { new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }
> : ^^^^^^^^^^ ^^^ ^^^^^^^^^^ ^^^ ^^^
@@ -668,8 +668,8 @@ module WithGenericSignaturesInBaseType {
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
declare function foo2(a2: new (x: T) => T[]): typeof a2;
->foo2 : { (a2: new (x: T) => T[]): new (x: T) => T[]; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo2 : { (a2: new (x: T) => T[]): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : new (x: T) => T[]
> : ^^^^^ ^^^^^ ^^^^^
>x : T
@@ -697,8 +697,8 @@ module WithGenericSignaturesInBaseType {
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
declare function foo3(a2: new (x: T) => string[]): typeof a2;
->foo3 : { (a2: new (x: T) => string[]): new (x: T) => string[]; (a2: any): any; }
-> : ^^^^^^^ ^^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^
+>foo3 : { (a2: new (x: T) => string[]): typeof a2; (a2: any): any; }
+> : ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
>a2 : new (x: T) => string[]
> : ^^^^^ ^^^^^ ^^^^^
>x : T