Preserve return type nodes which resolve to errors in declaration emit (#58522)

This commit is contained in:
Wesley Wigham
2024-05-13 11:55:01 -07:00
committed by GitHub
parent 8111503772
commit 56cfd6c3a8
57 changed files with 281 additions and 239 deletions
+1 -1
View File
@@ -8233,7 +8233,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function serializeReturnTypeForSignatureWorker(context: NodeBuilderContext, signature: Signature) {
const typePredicate = getTypePredicateOfSignature(signature);
const type = getReturnTypeOfSignature(signature);
if (!isErrorType(type) && context.enclosingDeclaration) {
if (context.enclosingDeclaration && (!isErrorType(type) || (context.flags & NodeBuilderFlags.AllowUnresolvedNames))) {
const annotation = signature.declaration && getNonlocalEffectiveReturnTypeAnnotationNode(signature.declaration);
const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
if (!!findAncestor(annotation, n => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
@@ -23,7 +23,7 @@ async function f1(): Promise<void> { }
async function f3(): MyPromise<void> { }
>f3 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
let f4 = async function() { }
>f4 : () => Promise<void>
@@ -39,9 +39,9 @@ let f5 = async function(): Promise<void> { }
let f6 = async function(): MyPromise<void> { }
>f6 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>async function(): MyPromise<void> { } : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
let f7 = async () => { };
>f7 : () => Promise<void>
@@ -57,9 +57,9 @@ let f8 = async (): Promise<void> => { };
let f9 = async (): MyPromise<void> => { };
>f9 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>async (): MyPromise<void> => { } : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
let f10 = async () => p;
>f10 : () => Promise<number>
@@ -87,17 +87,17 @@ let f12 = async (): Promise<number> => mp;
let f13 = async (): MyPromise<number> => p;
>f13 : () => MyPromise<number>
> : ^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>async (): MyPromise<number> => p : () => MyPromise<number>
> : ^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>p : Promise<number>
> : ^^^^^^^^^^^^^^^
let o = {
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^
async m1() { },
>m1 : () => Promise<void>
@@ -109,7 +109,7 @@ let o = {
async m3(): MyPromise<void> { }
>m3 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
};
@@ -127,7 +127,7 @@ class C {
async m3(): MyPromise<void> { }
>m3 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
static async m4() { }
>m4 : () => Promise<void>
@@ -139,7 +139,7 @@ class C {
static async m6(): MyPromise<void> { }
>m6 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
}
module M {
@@ -23,7 +23,7 @@ async function f1(): Promise<void> { }
async function f3(): MyPromise<void> { }
>f3 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
let f4 = async function() { }
>f4 : () => Promise<void>
@@ -39,9 +39,9 @@ let f5 = async function(): Promise<void> { }
let f6 = async function(): MyPromise<void> { }
>f6 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>async function(): MyPromise<void> { } : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
let f7 = async () => { };
>f7 : () => Promise<void>
@@ -57,9 +57,9 @@ let f8 = async (): Promise<void> => { };
let f9 = async (): MyPromise<void> => { };
>f9 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>async (): MyPromise<void> => { } : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
let f10 = async () => p;
>f10 : () => Promise<number>
@@ -87,17 +87,17 @@ let f12 = async (): Promise<number> => mp;
let f13 = async (): MyPromise<number> => p;
>f13 : () => MyPromise<number>
> : ^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>async (): MyPromise<number> => p : () => MyPromise<number>
> : ^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>p : Promise<number>
> : ^^^^^^^^^^^^^^^
let o = {
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^
async m1() { },
>m1 : () => Promise<void>
@@ -109,7 +109,7 @@ let o = {
async m3(): MyPromise<void> { }
>m3 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
};
@@ -127,7 +127,7 @@ class C {
async m3(): MyPromise<void> { }
>m3 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
static async m4() { }
>m4 : () => Promise<void>
@@ -139,7 +139,7 @@ class C {
static async m6(): MyPromise<void> { }
>m6 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
}
module M {
@@ -23,7 +23,7 @@ async function f1(): Promise<void> { }
async function f3(): MyPromise<void> { }
>f3 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
let f4 = async function() { }
>f4 : () => Promise<void>
@@ -39,9 +39,9 @@ let f5 = async function(): Promise<void> { }
let f6 = async function(): MyPromise<void> { }
>f6 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>async function(): MyPromise<void> { } : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
let f7 = async () => { };
>f7 : () => Promise<void>
@@ -57,9 +57,9 @@ let f8 = async (): Promise<void> => { };
let f9 = async (): MyPromise<void> => { };
>f9 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>async (): MyPromise<void> => { } : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
let f10 = async () => p;
>f10 : () => Promise<number>
@@ -87,17 +87,17 @@ let f12 = async (): Promise<number> => mp;
let f13 = async (): MyPromise<number> => p;
>f13 : () => MyPromise<number>
> : ^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>async (): MyPromise<number> => p : () => MyPromise<number>
> : ^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>p : Promise<number>
> : ^^^^^^^^^^^^^^^
let o = {
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): MyPromise<void>; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^
async m1() { },
>m1 : () => Promise<void>
@@ -109,7 +109,7 @@ let o = {
async m3(): MyPromise<void> { }
>m3 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
};
@@ -127,7 +127,7 @@ class C {
async m3(): MyPromise<void> { }
>m3 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
static async m4() { }
>m4 : () => Promise<void>
@@ -139,7 +139,7 @@ class C {
static async m6(): MyPromise<void> { }
>m6 : () => MyPromise<void>
> : ^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
}
module M {
@@ -7,7 +7,7 @@ import a1 = require("garbage");
export declare var a: {
>a : { (): a1.connectExport; test1: a1.connectModule; }
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
> : ^^^^^^ ^^^^^^^^^ ^^^
test1: a1.connectModule;
>test1 : a1.connectModule
@@ -147,7 +147,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
static defer<R>(dit: typeof Promise): Promise.Resolver<R>;
>defer : <R>(dit: typeof Promise) => Promise.Resolver<R>
> : ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^^^^
>dit : typeof Promise
> : ^^^^^^^^^^^^^^
>Promise : typeof Promise
@@ -1290,7 +1290,7 @@ module TypeScriptAllInOne {
interface IF {
Foo(): bool;
>Foo : () => bool
> : ^^^^^^^^^^
> : ^^^^^^
}
class CLASS implements IF {
@@ -1323,7 +1323,7 @@ module TypeScriptAllInOne {
}
public Foo(): bool {
>Foo : () => bool
> : ^^^^^^^^^^
> : ^^^^^^
var myEvent = () => { return 1; };
>myEvent : () => number
@@ -31,7 +31,7 @@ declare module "m2" {
function Z2(): X.I;
>Z2 : () => X.I
> : ^^^^^^^^^
> : ^^^^^^
>X : any
> : ^^^
}
@@ -19,7 +19,7 @@ declare module "m" {
export function bar(): X.bar; // error
>bar : () => X.bar
> : ^^^^^^^^^^^
> : ^^^^^^
>X : any
> : ^^^
}
@@ -18,7 +18,7 @@ export declare function foo(): X.foo;
export declare function bar(): X.bar; // error
>bar : () => X.bar
> : ^^^^^^^^^^^
> : ^^^^^^
>X : any
> : ^^^
@@ -6,7 +6,7 @@ function f(x: ()) {
>f : (x: () => any) => void
> : ^ ^^ ^^^^^^^^^
>x : () => any
> : ^^^^^^^^^
> : ^^^^^^
}
// Error (no '=>')
@@ -2,8 +2,8 @@
=== functionVariableInReturnTypeAnnotation.ts ===
function bar(): typeof b {
>bar : () => any
> : ^^^^^^^^^
>bar : () => typeof b
> : ^^^^^^
>b : any
> : ^^^
@@ -435,7 +435,7 @@ module TU {
>x : T
> : ^
>b : (x: U) => U
> : ^ ^^ ^^^^^^
> : ^ ^^ ^^^^^
>x : U
> : ^
@@ -10,8 +10,8 @@ module TypeScript {
> : ^^^^^^^^^^^^^^^^^^^
static create<A,B,C>(arg1: any, arg2?: any, arg3?: any): MemberName {
>create : <A, B, C>(arg1: any, arg2?: any, arg3?: any) => any
> : ^^^^^^^^^^ ^^ ^^ ^^^ ^^ ^^^ ^^^^^^^^
>create : <A, B, C>(arg1: any, arg2?: any, arg3?: any) => MemberName
> : ^^^^^^^^^^ ^^ ^^ ^^^ ^^ ^^^ ^^^^^
>arg1 : any
> : ^^^
>arg2 : any
@@ -24,8 +24,8 @@ declare var a: { x: C };
> : ^^^
declare var b: { (x: C): C };
>b : (x: C) => any
> : ^ ^^ ^^^^^^^^
>b : (x: C) => C
> : ^ ^^ ^^^^^
>x : any
> : ^^^
@@ -36,8 +36,8 @@ declare var d: { [x: C]: C };
> : ^^^
declare function f(x: C): C;
>f : (x: C) => any
> : ^ ^^ ^^^^^^^^
>f : (x: C) => C
> : ^ ^^ ^^^^^
>x : any
> : ^^^
@@ -24,8 +24,8 @@ var a: { x: C };
> : ^^^
var b: { (x: C): C };
>b : (x: C) => any
> : ^ ^^ ^^^^^^^^
>b : (x: C) => C
> : ^ ^^ ^^^^^
>x : any
> : ^^^
@@ -48,8 +48,8 @@ var e = (x: C) => { var y: C; return y; }
> : ^^^
function f(x: C): C { var y: C; return y; }
>f : (x: C) => any
> : ^ ^^ ^^^^^^^^
>f : (x: C) => C
> : ^ ^^ ^^^^^
>x : any
> : ^^^
>y : any
@@ -58,12 +58,12 @@ function f(x: C): C { var y: C; return y; }
> : ^^^
var g = function f(x: C): C { var y: C; return y; }
>g : (x: C) => any
> : ^ ^^ ^^^^^^^^
>function f(x: C): C { var y: C; return y; } : (x: C) => any
> : ^ ^^ ^^^^^^^^
>f : (x: C) => any
> : ^ ^^ ^^^^^^^^
>g : (x: C) => C
> : ^ ^^ ^^^^^
>function f(x: C): C { var y: C; return y; } : (x: C) => C
> : ^ ^^ ^^^^^
>f : (x: C) => C
> : ^ ^^ ^^^^^
>x : any
> : ^^^
>y : any
@@ -21,8 +21,8 @@ var a: { x: I };
> : ^^^
var b: { (x: I): I };
>b : (x: I) => any
> : ^ ^^ ^^^^^^^^
>b : (x: I) => I
> : ^ ^^ ^^^^^
>x : any
> : ^^^
@@ -45,8 +45,8 @@ var e = (x: I) => { var y: I; return y; }
> : ^^^
function f(x: I): I { var y: I; return y; }
>f : (x: I) => any
> : ^ ^^ ^^^^^^^^
>f : (x: I) => I
> : ^ ^^ ^^^^^
>x : any
> : ^^^
>y : any
@@ -55,12 +55,12 @@ function f(x: I): I { var y: I; return y; }
> : ^^^
var g = function f(x: I): I { var y: I; return y; }
>g : (x: I) => any
> : ^ ^^ ^^^^^^^^
>function f(x: I): I { var y: I; return y; } : (x: I) => any
> : ^ ^^ ^^^^^^^^
>f : (x: I) => any
> : ^ ^^ ^^^^^^^^
>g : (x: I) => I
> : ^ ^^ ^^^^^
>function f(x: I): I { var y: I; return y; } : (x: I) => I
> : ^ ^^ ^^^^^
>f : (x: I) => I
> : ^ ^^ ^^^^^
>x : any
> : ^^^
>y : any
@@ -24,8 +24,8 @@ declare var a: { x: C };
> : ^^^
declare var b: { (x: C): C };
>b : (x: C) => any
> : ^ ^^ ^^^^^^^^
>b : (x: C) => C
> : ^ ^^ ^^^^^
>x : any
> : ^^^
@@ -36,8 +36,8 @@ declare var d: { [x: C]: C };
> : ^^^
declare function f(x: C): C;
>f : (x: C) => any
> : ^ ^^ ^^^^^^^^
>f : (x: C) => C
> : ^ ^^ ^^^^^
>x : any
> : ^^^
@@ -106,8 +106,8 @@ class A<T> { }
> : ^^^^
function f<T>(x: T): A {
>f : <T>(x: T) => any
> : ^ ^^ ^^ ^^^^^^^^
>f : <T>(x: T) => A
> : ^ ^^ ^^ ^^^^^
>x : T
> : ^
@@ -14,8 +14,8 @@ export interface Foo {
}
=== usage.ts ===
export function getFooFrom<T extends "./a" | "./b">(v: T): import(T).Foo {
>getFooFrom : <T extends "./a" | "./b">(v: T) => any
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^
>getFooFrom : <T extends "./a" | "./b">(v: T) => import(T).Foo
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>v : T
> : ^
@@ -27,8 +27,8 @@ export function getFooFrom<T extends "./a" | "./b">(v: T): import(T).Foo {
}
export function getFooValueFrom<T extends "./a" | "./b">(v: T): import(T).Foo["a"] {
>getFooValueFrom : <T extends "./a" | "./b">(v: T) => any
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^
>getFooValueFrom : <T extends "./a" | "./b">(v: T) => import(T).Foo["a"]
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>v : T
> : ^
@@ -44,7 +44,7 @@ module C {
function hello(): b.B { return null; }
>hello : () => b.B
> : ^^^^^^^^^
> : ^^^^^^
>b : any
> : ^^^
}
+1 -1
View File
@@ -25,7 +25,7 @@ function f2() {
// Local types are not in scope in parameters and return types
function f(x: T): T {
>f : (x: T) => T
> : ^ ^^ ^^^^^^
> : ^ ^^ ^^^^^
>x : T
> : ^
@@ -11,8 +11,8 @@ class X<T> {
> : ^^^^
p1: () => X;
>p1 : () => any
> : ^^^^^^^^^
>p1 : () => X
> : ^^^^^^
}
var a: X<number>;
>a : X<number>
@@ -73,8 +73,8 @@ class X6<T> {
> : ^^^^^
p6: () => Y;
>p6 : () => any
> : ^^^^^^^^^
>p6 : () => Y
> : ^^^^^^
}
var a6: X6<number>;
>a6 : X6<number>
@@ -6,8 +6,8 @@ class A<T> { }
> : ^^^^
var x: () => A;
>x : () => any
> : ^^^^^^^^^
>x : () => A
> : ^^^^^^
(a: A) => { };
>(a: A) => { } : (a: A) => void
@@ -20,6 +20,6 @@ var y: A<A>;
> : ^^^^^^
(): A => null;
>(): A => null : () => any
> : ^^^^^^^^^
>(): A => null : () => A
> : ^^^^^^
@@ -80,7 +80,7 @@ declare module "./f1" {
interface A {
foo(): B;
>foo : () => B
> : ^^^^^^^
> : ^^^^^^
bar(): I;
>bar : () => I
@@ -75,7 +75,7 @@ declare module "./f1" {
interface A {
foo(): B;
>foo : () => B
> : ^^^^^^^
> : ^^^^^^
bar(): I;
>bar : () => I
@@ -6,8 +6,8 @@ class A<T>{
> : ^^^^
foo(): A{
>foo : () => any
> : ^^^^^^^^^
>foo : () => A
> : ^^^^^^
return null;
}
@@ -3,11 +3,11 @@
=== fileJs.js ===
a ? (b) : c => (d) : e => f // Not legal JS; "Unexpected token ':'" at last colon
>a ? (b) : c => (d) : e => f : (b: any) => c
> : ^ ^^^^^^^^^^^
> : ^ ^^^^^^^^^^
>a : any
> : ^^^
>(b) : c => (d) : (b: any) => c
> : ^ ^^^^^^^^^^^
> : ^ ^^^^^^^^^^
>b : any
> : ^^^
>(d) : any
@@ -24,11 +24,11 @@ a ? (b) : c => (d) : e => f // Not legal JS; "Unexpected token ':'" at last colo
=== fileTs.ts ===
a ? (b) : c => (d) : e => f
>a ? (b) : c => (d) : e => f : (b: any) => c
> : ^ ^^^^^^^^^^^
> : ^ ^^^^^^^^^^
>a : any
> : ^^^
>(b) : c => (d) : (b: any) => c
> : ^ ^^^^^^^^^^^
> : ^ ^^^^^^^^^^
>b : any
> : ^^^
>(d) : any
@@ -9,7 +9,7 @@ a ? b : (c) : d => e // Not legal JS; "Unexpected token ':'" at last colon
>b : any
> : ^^^
>(c) : d => e : (c: any) => d
> : ^ ^^^^^^^^^^^
> : ^ ^^^^^^^^^^
>c : any
> : ^^^
>e : any
@@ -24,7 +24,7 @@ a ? b : (c) : d => e
>b : any
> : ^^^
>(c) : d => e : (c: any) => d
> : ^ ^^^^^^^^^^^
> : ^ ^^^^^^^^^^
>c : any
> : ^^^
>e : any
@@ -44,7 +44,7 @@ function f1(a: E<T>) {
function f2(): F<T> {
>f2 : () => F<T>
> : ^^^^^^^^^^
> : ^^^^^^
}
@@ -44,7 +44,7 @@ function f1(a: E<X<T>, Y<Z<T>>>) {
function f2(): F<X<T>, Y<Z<T>>> {
>f2 : () => F<X<T>, Y<Z<T>>>
> : ^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
}
@@ -7,7 +7,7 @@ class C {
where(filter: Iterator<T, boolean>): Query<T> {
>where : (filter: Iterator<T, boolean>) => Query<T>
> : ^ ^^ ^^^^^^^^^^^^^
> : ^ ^^ ^^^^^
>filter : Iterator<T, boolean>
> : ^^^^^^^^^^^^^^^^^^^^
@@ -7728,7 +7728,7 @@ module TypeScript {
public buildControlFlow(): ControlFlowContext {
>buildControlFlow : () => ControlFlowContext
> : ^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
var entry = new BasicBlock();
>entry : any
@@ -13,7 +13,7 @@ module TypeScript {
export interface IAstWalker {
walk(ast: AST, parent: AST): AST;
>walk : (ast: AST, parent: AST) => AST
> : ^ ^^ ^^ ^^ ^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>ast : AST
> : ^^^
>parent : AST
@@ -136,7 +136,7 @@ module TypeScript {
public walk(ast: AST, parent: AST): AST {
>walk : (ast: AST, parent: AST) => AST
> : ^ ^^ ^^ ^^ ^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>ast : AST
> : ^^^
>parent : AST
@@ -355,7 +355,7 @@ module TypeScript {
public walk(ast: AST, pre: IAstWalkCallback, post?: IAstWalkCallback, options?: AstWalkOptions, state?: any): AST {
>walk : (ast: AST, pre: IAstWalkCallback, post?: IAstWalkCallback, options?: AstWalkOptions, state?: any) => AST
> : ^ ^^ ^^ ^^ ^^ ^^^ ^^ ^^^ ^^ ^^^ ^^^^^^^^
> : ^ ^^ ^^ ^^ ^^ ^^^ ^^ ^^^ ^^ ^^^ ^^^^^
>ast : AST
> : ^^^
>pre : IAstWalkCallback
@@ -235,7 +235,7 @@ module TypeScript {
public pop(): TypeScript.AST {
>pop : () => TypeScript.AST
> : ^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>TypeScript : any
> : ^^^
@@ -469,7 +469,7 @@ module TypeScript {
public nodeType(): TypeScript.NodeType {
>nodeType : () => TypeScript.NodeType
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>TypeScript : any
> : ^^^
@@ -623,7 +623,7 @@ module TypeScript {
public get(index: number): TypeScript.AST {
>get : (index: number) => TypeScript.AST
> : ^ ^^ ^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^^^^
>index : number
> : ^^^^^^
>TypeScript : any
@@ -7467,9 +7467,9 @@ module TypeScript {
var pre = (cur: TypeScript.AST, parent: TypeScript.AST, walker: TypeScript.IAstWalker): TypeScript.AST => {
>pre : (cur: TypeScript.AST, parent: TypeScript.AST, walker: TypeScript.IAstWalker) => TypeScript.AST
> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^
>(cur: TypeScript.AST, parent: TypeScript.AST, walker: TypeScript.IAstWalker): TypeScript.AST => { if (TypeScript.isValidAstNode(cur)) { // Did we find a closer offset? if (cur.minChar <= position) { bestOffset = max(bestOffset, cur.minChar); } // Stop the walk if this node is not related to "minChar" if (cur.minChar > position || cur.limChar < bestOffset) { walker.options.goChildren = false; } } return cur; } : (cur: TypeScript.AST, parent: TypeScript.AST, walker: TypeScript.IAstWalker) => TypeScript.AST
> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^
>cur : TypeScript.AST
> : ^^^^^^^^^^^^^^
>TypeScript : any
@@ -66,11 +66,11 @@ module TypeScript {
public scopeGetter: () => SymbolScope = null;
>scopeGetter : () => SymbolScope
> : ^^^^^^^^^^^^^^^^^
> : ^^^^^^
public objectLiteralScopeGetter: () => SymbolScope = null;
>objectLiteralScopeGetter : () => SymbolScope
> : ^^^^^^^^^^^^^^^^^
> : ^^^^^^
public scopeStartAST: AST = null;
>scopeStartAST : AST
@@ -133,7 +133,7 @@ module TypeScript {
public getScope(): SymbolScope {
>getScope : () => SymbolScope
> : ^^^^^^^^^^^^^^^^^
> : ^^^^^^
return this.scopeGetter();
>this.scopeGetter() : SymbolScope
@@ -148,7 +148,7 @@ module TypeScript {
public getObjectLiteralScope(): SymbolScope {
>getObjectLiteralScope : () => SymbolScope
> : ^^^^^^^^^^^^^^^^^
> : ^^^^^^
return this.objectLiteralScopeGetter();
>this.objectLiteralScopeGetter() : SymbolScope
@@ -193,7 +193,7 @@ module TypeScript {
public getScriptFragmentStartAST(): AST {
>getScriptFragmentStartAST : () => AST
> : ^^^^^^^^^
> : ^^^^^^
return this.scopeStartAST;
>this.scopeStartAST : AST
@@ -225,7 +225,7 @@ module TypeScript {
public getScriptFragment(): Script {
>getScriptFragment : () => Script
> : ^^^^^^^^^^^^
> : ^^^^^^
if (this.scriptFragment == null) {
>this.scriptFragment == null : boolean
@@ -4,7 +4,7 @@
interface IQService {
all(promises: IPromise < any > []): IPromise<
>all : (promises: IPromise<any>[]) => IPromise
> : ^ ^^ ^^^^^^^^^^^^^
> : ^ ^^ ^^^^^
>promises : IPromise<any>[]
> : ^^^^^^^^^^^^^^^
@@ -39,7 +39,7 @@ declare module ng {
interface IQService {
all(promises: IPromise < any > []): IPromise<
>all : (promises: IPromise<any>[]) => IPromise
> : ^ ^^ ^^^^^^^^^^^^^
> : ^ ^^ ^^^^^
>promises : IPromise<any>[]
> : ^^^^^^^^^^^^^^^
@@ -4320,7 +4320,7 @@ module Harness {
/** create file gets the whole path to create, so this works as expected with the --out parameter */
public createFile(s: string, useUTF8?: boolean): ITextWriter {
>createFile : (s: string, useUTF8?: boolean) => ITextWriter
> : ^ ^^ ^^ ^^^ ^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^^ ^^^^^
>s : string
> : ^^^^^^
>useUTF8 : boolean
@@ -10623,7 +10623,7 @@ module Harness {
public getEditRangeSinceVersion(version: number): TypeScript.ScriptEditRange {
>getEditRangeSinceVersion : (version: number) => TypeScript.ScriptEditRange
> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^^^^
>version : number
> : ^^^^^^
>TypeScript : any
@@ -11557,7 +11557,7 @@ module Harness {
*/
public getLanguageService(): Services.ILanguageServiceShim {
>getLanguageService : () => Services.ILanguageServiceShim
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>Services : any
> : ^^^
@@ -11613,7 +11613,7 @@ module Harness {
/** Parse file given its source text */
public parseSourceText(fileName: string, sourceText: TypeScript.ISourceText): TypeScript.Script {
>parseSourceText : (fileName: string, sourceText: TypeScript.ISourceText) => TypeScript.Script
> : ^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>fileName : string
> : ^^^^^^
>sourceText : TypeScript.ISourceText
@@ -11871,7 +11871,7 @@ module Harness {
*/
public positionToZeroBasedLineCol(fileName: string, position: number): TypeScript.ILineCol {
>positionToZeroBasedLineCol : (fileName: string, position: number) => TypeScript.ILineCol
> : ^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>fileName : string
> : ^^^^^^
>position : number
+11 -11
View File
@@ -183,7 +183,7 @@ module Formatting {
public GetIndentationEdits(token: TokenSpan, nextToken: TokenSpan, node: ParseNode, sameLineIndent: boolean): List_TextEditInfo {
>GetIndentationEdits : (token: TokenSpan, nextToken: TokenSpan, node: ParseNode, sameLineIndent: boolean) => List_TextEditInfo
> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^
>token : TokenSpan
> : ^^^^^^^^^
>nextToken : TokenSpan
@@ -477,7 +477,7 @@ module Formatting {
public GetIndentationEditsWorker(token: TokenSpan, nextToken: TokenSpan, node: ParseNode, sameLineIndent: boolean): List_TextEditInfo {
>GetIndentationEditsWorker : (token: TokenSpan, nextToken: TokenSpan, node: ParseNode, sameLineIndent: boolean) => List_TextEditInfo
> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^
>token : TokenSpan
> : ^^^^^^^^^
>nextToken : TokenSpan
@@ -960,7 +960,7 @@ module Formatting {
private GetCommentIndentationEdits(token: TokenSpan): List_TextEditInfo {
>GetCommentIndentationEdits : (token: TokenSpan) => List_TextEditInfo
> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^^^^
>token : TokenSpan
> : ^^^^^^^^^
@@ -1371,7 +1371,7 @@ module Formatting {
private GetSpecialCaseIndentation(token: TokenSpan, node: ParseNode): IndentationInfo {
>GetSpecialCaseIndentation : (token: TokenSpan, node: ParseNode) => IndentationInfo
> : ^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>token : TokenSpan
> : ^^^^^^^^^
>node : ParseNode
@@ -1646,7 +1646,7 @@ module Formatting {
private GetSpecialCaseIndentationForLCurly(node: ParseNode): IndentationInfo {
>GetSpecialCaseIndentationForLCurly : (node: ParseNode) => IndentationInfo
> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^^^^
>node : ParseNode
> : ^^^^^^^^^
@@ -1805,7 +1805,7 @@ module Formatting {
private GetSpecialCaseIndentationForSemicolon(token: TokenSpan, node: ParseNode): IndentationInfo {
>GetSpecialCaseIndentationForSemicolon : (token: TokenSpan, node: ParseNode) => IndentationInfo
> : ^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>token : TokenSpan
> : ^^^^^^^^^
>node : ParseNode
@@ -1941,7 +1941,7 @@ module Formatting {
private GetSpecialCaseIndentationForComment(token: TokenSpan, node: ParseNode): IndentationInfo {
>GetSpecialCaseIndentationForComment : (token: TokenSpan, node: ParseNode) => IndentationInfo
> : ^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>token : TokenSpan
> : ^^^^^^^^^
>node : ParseNode
@@ -2441,7 +2441,7 @@ module Formatting {
private GetIndentEdit(indentInfo: IndentationInfo, tokenStartPosition: number, sameLineIndent: boolean): TextEditInfo {
>GetIndentEdit : (indentInfo: IndentationInfo, tokenStartPosition: number, sameLineIndent: boolean) => TextEditInfo
> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^
>indentInfo : IndentationInfo
> : ^^^^^^^^^^^^^^^
>tokenStartPosition : number
@@ -3005,7 +3005,7 @@ module Formatting {
private ApplyIndentationDeltaFromParent(token: TokenSpan, node: ParseNode): IndentationInfo {
>ApplyIndentationDeltaFromParent : (token: TokenSpan, node: ParseNode) => IndentationInfo
> : ^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>token : TokenSpan
> : ^^^^^^^^^
>node : ParseNode
@@ -3164,7 +3164,7 @@ module Formatting {
private ApplyIndentationDelta1(tokenStartPosition: number, delta: number): IndentationInfo {
>ApplyIndentationDelta1 : (tokenStartPosition: number, delta: number) => IndentationInfo
> : ^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>tokenStartPosition : number
> : ^^^^^^
>delta : number
@@ -3253,7 +3253,7 @@ module Formatting {
private ApplyIndentationDelta2(currentIndent: string, delta: number): IndentationInfo {
>ApplyIndentationDelta2 : (currentIndent: string, delta: number) => IndentationInfo
> : ^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>currentIndent : string
> : ^^^^^^
>delta : number
@@ -1542,7 +1542,7 @@ export declare module "use_glo_M1_public" {
export var use_glo_M2_public_v1_public: { new (): use_glo_M2_public.c1; };
>use_glo_M2_public_v1_public : new () => use_glo_M2_public.c1
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^
>use_glo_M2_public : any
> : ^^^
@@ -1552,13 +1552,13 @@ export declare module "use_glo_M1_public" {
export var use_glo_M2_public_v3_public: () => use_glo_M2_public.c1;
>use_glo_M2_public_v3_public : () => use_glo_M2_public.c1
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>use_glo_M2_public : any
> : ^^^
var use_glo_M2_public_v1_private: { new (): use_glo_M2_public.c1; };
>use_glo_M2_public_v1_private : new () => use_glo_M2_public.c1
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^
>use_glo_M2_public : any
> : ^^^
@@ -1568,7 +1568,7 @@ export declare module "use_glo_M1_public" {
var use_glo_M2_public_v3_private: () => use_glo_M2_public.c1;
>use_glo_M2_public_v3_private : () => use_glo_M2_public.c1
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>use_glo_M2_public : any
> : ^^^
@@ -1646,7 +1646,7 @@ declare module "use_glo_M3_private" {
export var use_glo_M4_private_v1_public: { new (): use_glo_M4_private.c1; };
>use_glo_M4_private_v1_public : new () => use_glo_M4_private.c1
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^
>use_glo_M4_private : any
> : ^^^
@@ -1656,13 +1656,13 @@ declare module "use_glo_M3_private" {
export var use_glo_M4_private_v3_public: () => use_glo_M4_private.c1;
>use_glo_M4_private_v3_public : () => use_glo_M4_private.c1
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>use_glo_M4_private : any
> : ^^^
var use_glo_M4_private_v1_private: { new (): use_glo_M4_private.c1; };
>use_glo_M4_private_v1_private : new () => use_glo_M4_private.c1
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^
>use_glo_M4_private : any
> : ^^^
@@ -1672,7 +1672,7 @@ declare module "use_glo_M3_private" {
var use_glo_M4_private_v3_private: () => use_glo_M4_private.c1;
>use_glo_M4_private_v3_private : () => use_glo_M4_private.c1
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
>use_glo_M4_private : any
> : ^^^
@@ -38,7 +38,7 @@ declare namespace lf {
stats(): TransactionStats
>stats : () => TransactionStats
> : ^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^
}
}
=== lovefield.js ===
@@ -34,7 +34,7 @@ declare module Sample.Thing {
getDomNode(): Element;
>getDomNode : () => Element
> : ^^^^^^^^^^^^^
> : ^^^^^^
addWidget(widgetId:string, widget:IWidget);
>addWidget : (widgetId: string, widget: IWidget) => any
@@ -54,7 +54,7 @@ declare module Bacon {
>initState : U
> : ^
>f : (state: U, event: Event<T>) => StateValue<U, V>
> : ^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>state : U
> : ^
>event : Event<T>
@@ -39,56 +39,56 @@ class Three<T, U, V>{
}
function A1(): One { return null; }
>A1 : () => any
> : ^^^^^^^^^
>A1 : () => One
> : ^^^^^^
function A2(): Two { return null; }
>A2 : () => any
> : ^^^^^^^^^
>A2 : () => Two
> : ^^^^^^
function A3(): Three { return null; }
>A3 : () => any
> : ^^^^^^^^^
>A3 : () => Three
> : ^^^^^^
function B1(): Two<number> { return null; }
>B1 : () => any
> : ^^^^^^^^^
>B1 : () => Two<number>
> : ^^^^^^
function B2(): Three<string> { return null; }
>B2 : () => any
> : ^^^^^^^^^
>B2 : () => Three<string>
> : ^^^^^^
function B3(): Three<string, number> { return null; }
>B3 : () => any
> : ^^^^^^^^^
>B3 : () => Three<string, number>
> : ^^^^^^
class C {
>C : C
> : ^
A1(): One { return null; }
>A1 : () => any
> : ^^^^^^^^^
>A1 : () => One
> : ^^^^^^
A2(): Two { return null; }
>A2 : () => any
> : ^^^^^^^^^
>A2 : () => Two
> : ^^^^^^
A3(): Three { return null; }
>A3 : () => any
> : ^^^^^^^^^
>A3 : () => Three
> : ^^^^^^
B1(): Two<number> { return null; }
>B1 : () => any
> : ^^^^^^^^^
>B1 : () => Two<number>
> : ^^^^^^
B2(): Three<string> { return null; }
>B2 : () => any
> : ^^^^^^^^^
>B2 : () => Three<string>
> : ^^^^^^
B3(): Three<string, number> { return null; }
>B3 : () => any
> : ^^^^^^^^^
>B3 : () => Three<string, number>
> : ^^^^^^
}
class D<T> {
@@ -96,24 +96,24 @@ class D<T> {
> : ^^^^
A2(): Two<T> { return null; }
>A2 : () => any
> : ^^^^^^^^^
>A2 : () => Two<T>
> : ^^^^^^
A3(): Three<T> { return null; }
>A3 : () => any
> : ^^^^^^^^^
>A3 : () => Three<T>
> : ^^^^^^
B1(): Two<T> { return null; }
>B1 : () => any
> : ^^^^^^^^^
>B1 : () => Two<T>
> : ^^^^^^
B2(): Three<T> { return null; }
>B2 : () => any
> : ^^^^^^^^^
>B2 : () => Three<T>
> : ^^^^^^
B3(): Three<string, T> { return null; }
>B3 : () => any
> : ^^^^^^^^^
>B3 : () => Three<string, T>
> : ^^^^^^
}
interface I<T> {
@@ -136,8 +136,8 @@ class X<T>
> : ^^^^
{
p1: () => X;
>p1 : () => any
> : ^^^^^^^^^
>p1 : () => X
> : ^^^^^^
p2: { [idx: number]: X }
>p2 : { [idx: number]: any; }
@@ -158,8 +158,8 @@ class X<T>
> : ^^^
p6: () => Y;
>p6 : () => any
> : ^^^^^^^^^
>p6 : () => Y
> : ^^^^^^
p7: { [idx: number]: Y }
>p7 : { [idx: number]: any; }
@@ -185,8 +185,8 @@ declare var a: {
> : ^^^^^^ ^^^^^^ ^^^^^^ ^^^^^^ ^^^^^^ ^^^^^^ ^^^^^^ ^^^^^^ ^^^^^^ ^^^^^^ ^^^
p1: () => X;
>p1 : () => any
> : ^^^^^^^^^
>p1 : () => X
> : ^^^^^^
p2: { [idx: number]: X }
>p2 : { [idx: number]: any; }
@@ -207,8 +207,8 @@ declare var a: {
> : ^^^
p6: () => Y;
>p6 : () => any
> : ^^^^^^^^^
>p6 : () => Y
> : ^^^^^^
p7: { [idx: number]: Y }
>p7 : { [idx: number]: any; }
@@ -45,7 +45,7 @@ module Foo.Bar {
function foo(greeting: string): Foo.Bar.Greeter {
>foo : (greeting: string) => Foo.Bar.Greeter
> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^
> : ^ ^^ ^^^^^
>greeting : string
> : ^^^^^^
>Foo : any
+34 -34
View File
@@ -16,8 +16,8 @@ var x3: this[];
> : ^^^^^
function f1(x: this): this {
>f1 : (x: this) => any
> : ^ ^^ ^^^^^^^^
>f1 : (x: this) => this
> : ^ ^^ ^^^^^
>x : any
> : ^^^
@@ -38,12 +38,12 @@ interface I1 {
> : ^^^
b: { (): this };
>b : () => any
> : ^^^^^^^^^
>b : () => this
> : ^^^^^^
c: { new (): this };
>c : new () => any
> : ^^^^^^^^^^^^^
>c : new () => this
> : ^^^^^^^^^^
d: { [x: string]: this };
>d : { [x: string]: any; }
@@ -52,10 +52,10 @@ interface I1 {
> : ^^^^^^
e: { f(x: this): this };
>e : { f(x: this): any; }
> : ^^^^ ^^ ^^^^^^^^^
>f : (x: this) => any
> : ^ ^^ ^^^^^^^^
>e : { f(x: this): this; }
> : ^^^^ ^^ ^^^ ^^^
>f : (x: this) => this
> : ^ ^^ ^^^^^
>x : any
> : ^^^
}
@@ -71,12 +71,12 @@ class C1 {
> : ^^^
b: { (): this };
>b : () => any
> : ^^^^^^^^^
>b : () => this
> : ^^^^^^
c: { new (): this };
>c : new () => any
> : ^^^^^^^^^^^^^
>c : new () => this
> : ^^^^^^^^^^
d: { [x: string]: this };
>d : { [x: string]: any; }
@@ -85,10 +85,10 @@ class C1 {
> : ^^^^^^
e: { f(x: this): this };
>e : { f(x: this): any; }
> : ^^^^ ^^ ^^^^^^^^^
>f : (x: this) => any
> : ^ ^^ ^^^^^^^^
>e : { f(x: this): this; }
> : ^^^^ ^^ ^^^ ^^^
>f : (x: this) => this
> : ^ ^^ ^^^^^
>x : any
> : ^^^
}
@@ -110,8 +110,8 @@ class C2 {
> : ^^^^^^^^^
static foo(x: this): this {
>foo : (x: this) => any
> : ^ ^^ ^^^^^^^^
>foo : (x: this) => this
> : ^ ^^ ^^^^^
>x : any
> : ^^^
@@ -141,14 +141,14 @@ class C3 {
> : ^^
x1 = {
>x1 : { g(x: this): any; }
> : ^^^^ ^^ ^^^^^^^^^
>{ g(x: this): this { return undefined; } } : { g(x: this): any; }
> : ^^^^ ^^ ^^^^^^^^^
>x1 : { g(x: this): this; }
> : ^^^^ ^^ ^^^ ^^^
>{ g(x: this): this { return undefined; } } : { g(x: this): this; }
> : ^^^^ ^^ ^^^ ^^^
g(x: this): this {
>g : (x: this) => any
> : ^ ^^ ^^^^^^^^
>g : (x: this) => this
> : ^ ^^ ^^^^^
>x : any
> : ^^^
@@ -162,8 +162,8 @@ class C3 {
> : ^^^^^^^^^^
function g(x: this): this {
>g : (x: this) => any
> : ^ ^^ ^^^^^^^^
>g : (x: this) => this
> : ^ ^^ ^^^^^
>x : any
> : ^^^
@@ -172,14 +172,14 @@ class C3 {
> : ^^^^^^^^^
}
let x2 = {
>x2 : { h(x: this): any; }
> : ^^^^ ^^ ^^^^^^^^^
>{ h(x: this): this { return undefined; } } : { h(x: this): any; }
> : ^^^^ ^^ ^^^^^^^^^
>x2 : { h(x: this): this; }
> : ^^^^ ^^ ^^^ ^^^
>{ h(x: this): this { return undefined; } } : { h(x: this): this; }
> : ^^^^ ^^ ^^^ ^^^
h(x: this): this {
>h : (x: this) => any
> : ^ ^^ ^^^^^^^^
>h : (x: this) => this
> : ^ ^^ ^^^^^
>x : any
> : ^^^
@@ -0,0 +1,15 @@
//// [declarationLocalAliasOfImportAlias.ts] ////
import { Record } from "./a";
export type Foo<K extends string> = Record<K, number>;
export const obj = {
doThing<K extends string>(_k: K): Foo<K> {
return {} as any;
},
};
//// [declarationLocalAliasOfImportAlias.d.ts] ////
import { Record } from "./a";
export type Foo<K extends string> = Record<K, number>;
export declare const obj: {
doThing<K extends string>(_k: K): Foo<K>;
};
@@ -0,0 +1,18 @@
//// [declarationLocalAliasOfImportAlias.ts] ////
import { Record } from "./a";
export type Foo<K extends string> = Record<K, number>;
export const obj = {
doThing<K extends string>(_k: K): Foo<K> {
return {} as any;
},
};
//// [declarationLocalAliasOfImportAlias.js] ////
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.obj = void 0;
exports.obj = {
doThing: function (_k) {
return {};
},
};
@@ -58,7 +58,7 @@ function hasTypeGuardTypeInsideTypeGuardType(x): x is x is A {
function hasMissingIsKeyword(): x {
>hasMissingIsKeyword : () => x
> : ^^^^^^^
> : ^^^^^^
return true;
>true : true
@@ -50,7 +50,7 @@ interface I<T, U extends T, V extends U> {
function foo<T, U extends T>(x: T, y: U): V { // error
>foo : <T, U extends T>(x: T, y: U) => V
> : ^ ^^ ^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^
> : ^ ^^ ^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^
>x : T
> : ^
>y : U
@@ -58,7 +58,7 @@ function foo<T, U extends T>(x: T, y: U): V { // error
function bar<V extends T, W extends U>(): X { // error
>bar : <V extends T, W extends U>() => X
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
function baz<X extends W, Y extends V>(a: X, b: Y): T {
>baz : <X extends W, Y extends V>(a: X, b: Y) => T
@@ -85,7 +85,7 @@ function foo<T, U extends T>(x: T, y: U): V { // error
function foo2<U extends T, T>(x: T, y: U): W { // error
>foo2 : <U extends T, T>(x: T, y: U) => W
> : ^ ^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^
> : ^ ^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^
>x : T
> : ^
>y : U
@@ -93,7 +93,7 @@ function foo2<U extends T, T>(x: T, y: U): W { // error
function bar<V extends T, W extends U>(): Y { // error
>bar : <V extends T, W extends U>() => Y
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
function baz<X extends W, Y extends V>(a: X, b: Y): T {
>baz : <X extends W, Y extends V>(a: X, b: Y) => T
@@ -7,7 +7,7 @@ class foo<T> {
static get Foo(): () => T { return null; }
>Foo : () => T
> : ^^^^^^^
> : ^^^^^^
static set Bar(v: { v: T }) { }
>Bar : { v: T; }
@@ -9,8 +9,8 @@
* @return {T}
*/
function f(x) {
>f : <U>(x: U) => U
> : ^ ^^ ^^ ^^^^^^
>f : <U>(x: U) => T
> : ^ ^^ ^^ ^^^^^
>x : U
> : ^
@@ -19,7 +19,7 @@ interface Query<T> {
>item : T
> : ^
>resultSelector : (outer: T, inner: U) => R
> : ^ ^^ ^^ ^^ ^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>outer : T
> : ^
>inner : U
@@ -11,7 +11,7 @@ class Linq {
>values : T[]
> : ^^^
>func : (v: T) => A
> : ^ ^^ ^^^^^^
> : ^ ^^ ^^^^^
>v : T
> : ^
@@ -13,7 +13,7 @@ var y: asdf;
function foo(x: asdf, y: number): asdf { }
>foo : (x: asdf, y: number) => asdf
> : ^ ^^ ^^ ^^ ^^^^^^^^^
> : ^ ^^ ^^ ^^ ^^^^^
>x : asdf
> : ^^^^
>y : number
@@ -0,0 +1,9 @@
// @declaration: true
import { Record } from "./a";
export type Foo<K extends string> = Record<K, number>;
export const obj = {
doThing<K extends string>(_k: K): Foo<K> {
return {} as any;
},
};