mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
New test and baselines
This commit is contained in:
@@ -54,7 +54,7 @@ function f2() {
|
||||
>X : X
|
||||
|
||||
class C<Y> {
|
||||
>C : C<X, Y>
|
||||
>C : C<Y>
|
||||
>Y : Y
|
||||
|
||||
public x = x;
|
||||
@@ -75,21 +75,21 @@ function f2() {
|
||||
>10 : number
|
||||
|
||||
let v = new C("hello");
|
||||
>v : C<number, string>
|
||||
>new C("hello") : C<number, string>
|
||||
>v : f<number>.C<string>
|
||||
>new C("hello") : f<number>.C<string>
|
||||
>C : typeof C
|
||||
>"hello" : string
|
||||
|
||||
let x = v.x;
|
||||
>x : number
|
||||
>v.x : number
|
||||
>v : C<number, string>
|
||||
>v : f<number>.C<string>
|
||||
>x : number
|
||||
|
||||
let y = v.y;
|
||||
>y : string
|
||||
>v.y : string
|
||||
>v : C<number, string>
|
||||
>v : f<number>.C<string>
|
||||
>y : string
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ function f3() {
|
||||
>Y : Y
|
||||
|
||||
class C {
|
||||
>C : C<X, Y>
|
||||
>C : C
|
||||
|
||||
public x = x;
|
||||
>x : X
|
||||
@@ -127,20 +127,20 @@ function f3() {
|
||||
>"hello" : string
|
||||
|
||||
let v = new C();
|
||||
>v : C<number, string>
|
||||
>new C() : C<number, string>
|
||||
>v : f<number, string>.C
|
||||
>new C() : f<number, string>.C
|
||||
>C : typeof C
|
||||
|
||||
let x = v.x;
|
||||
>x : number
|
||||
>v.x : number
|
||||
>v : C<number, string>
|
||||
>v : f<number, string>.C
|
||||
>x : number
|
||||
|
||||
let y = v.y;
|
||||
>y : string
|
||||
>v.y : string
|
||||
>v : C<number, string>
|
||||
>v : f<number, string>.C
|
||||
>y : string
|
||||
}
|
||||
|
||||
|
||||
38
tests/baselines/reference/localTypes5.js
Normal file
38
tests/baselines/reference/localTypes5.js
Normal file
@@ -0,0 +1,38 @@
|
||||
//// [localTypes5.ts]
|
||||
function foo<A>() {
|
||||
class X {
|
||||
m<B, C>() {
|
||||
return (function <D>() {
|
||||
class Y<E> {
|
||||
}
|
||||
return new Y<string>();
|
||||
})<Date>();
|
||||
}
|
||||
}
|
||||
var x = new X();
|
||||
return x.m<number, boolean>();
|
||||
}
|
||||
var x = foo<void>();
|
||||
|
||||
|
||||
//// [localTypes5.js]
|
||||
function foo() {
|
||||
var X = (function () {
|
||||
function X() {
|
||||
}
|
||||
X.prototype.m = function () {
|
||||
return (function () {
|
||||
var Y = (function () {
|
||||
function Y() {
|
||||
}
|
||||
return Y;
|
||||
})();
|
||||
return new Y();
|
||||
})();
|
||||
};
|
||||
return X;
|
||||
})();
|
||||
var x = new X();
|
||||
return x.m();
|
||||
}
|
||||
var x = foo();
|
||||
40
tests/baselines/reference/localTypes5.symbols
Normal file
40
tests/baselines/reference/localTypes5.symbols
Normal file
@@ -0,0 +1,40 @@
|
||||
=== tests/cases/conformance/types/localTypes/localTypes5.ts ===
|
||||
function foo<A>() {
|
||||
>foo : Symbol(foo, Decl(localTypes5.ts, 0, 0))
|
||||
>A : Symbol(A, Decl(localTypes5.ts, 0, 13))
|
||||
|
||||
class X {
|
||||
>X : Symbol(X, Decl(localTypes5.ts, 0, 19))
|
||||
|
||||
m<B, C>() {
|
||||
>m : Symbol(m, Decl(localTypes5.ts, 1, 13))
|
||||
>B : Symbol(B, Decl(localTypes5.ts, 2, 10))
|
||||
>C : Symbol(C, Decl(localTypes5.ts, 2, 12))
|
||||
|
||||
return (function <D>() {
|
||||
>D : Symbol(D, Decl(localTypes5.ts, 3, 30))
|
||||
|
||||
class Y<E> {
|
||||
>Y : Symbol(Y, Decl(localTypes5.ts, 3, 36))
|
||||
>E : Symbol(E, Decl(localTypes5.ts, 4, 24))
|
||||
}
|
||||
return new Y<string>();
|
||||
>Y : Symbol(Y, Decl(localTypes5.ts, 3, 36))
|
||||
|
||||
})<Date>();
|
||||
>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11))
|
||||
}
|
||||
}
|
||||
var x = new X();
|
||||
>x : Symbol(x, Decl(localTypes5.ts, 10, 7))
|
||||
>X : Symbol(X, Decl(localTypes5.ts, 0, 19))
|
||||
|
||||
return x.m<number, boolean>();
|
||||
>x.m : Symbol(X.m, Decl(localTypes5.ts, 1, 13))
|
||||
>x : Symbol(x, Decl(localTypes5.ts, 10, 7))
|
||||
>m : Symbol(X.m, Decl(localTypes5.ts, 1, 13))
|
||||
}
|
||||
var x = foo<void>();
|
||||
>x : Symbol(x, Decl(localTypes5.ts, 13, 3))
|
||||
>foo : Symbol(foo, Decl(localTypes5.ts, 0, 0))
|
||||
|
||||
47
tests/baselines/reference/localTypes5.types
Normal file
47
tests/baselines/reference/localTypes5.types
Normal file
@@ -0,0 +1,47 @@
|
||||
=== tests/cases/conformance/types/localTypes/localTypes5.ts ===
|
||||
function foo<A>() {
|
||||
>foo : <A>() => X.m<number, boolean>.<Date>.Y<string>
|
||||
>A : A
|
||||
|
||||
class X {
|
||||
>X : X
|
||||
|
||||
m<B, C>() {
|
||||
>m : <B, C>() => <Date>.Y<string>
|
||||
>B : B
|
||||
>C : C
|
||||
|
||||
return (function <D>() {
|
||||
>(function <D>() { class Y<E> { } return new Y<string>(); })<Date>() : <Date>.Y<string>
|
||||
>(function <D>() { class Y<E> { } return new Y<string>(); }) : <D>() => Y<string>
|
||||
>function <D>() { class Y<E> { } return new Y<string>(); } : <D>() => Y<string>
|
||||
>D : D
|
||||
|
||||
class Y<E> {
|
||||
>Y : Y<E>
|
||||
>E : E
|
||||
}
|
||||
return new Y<string>();
|
||||
>new Y<string>() : Y<string>
|
||||
>Y : typeof Y
|
||||
|
||||
})<Date>();
|
||||
>Date : Date
|
||||
}
|
||||
}
|
||||
var x = new X();
|
||||
>x : X
|
||||
>new X() : X
|
||||
>X : typeof X
|
||||
|
||||
return x.m<number, boolean>();
|
||||
>x.m<number, boolean>() : X.m<number, boolean>.<Date>.Y<string>
|
||||
>x.m : <B, C>() => <Date>.Y<string>
|
||||
>x : X
|
||||
>m : <B, C>() => <Date>.Y<string>
|
||||
}
|
||||
var x = foo<void>();
|
||||
>x : foo<void>.X.m<number, boolean>.<Date>.Y<string>
|
||||
>foo<void>() : foo<void>.X.m<number, boolean>.<Date>.Y<string>
|
||||
>foo : <A>() => X.m<number, boolean>.<Date>.Y<string>
|
||||
|
||||
14
tests/cases/conformance/types/localTypes/localTypes5.ts
Normal file
14
tests/cases/conformance/types/localTypes/localTypes5.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
function foo<A>() {
|
||||
class X {
|
||||
m<B, C>() {
|
||||
return (function <D>() {
|
||||
class Y<E> {
|
||||
}
|
||||
return new Y<string>();
|
||||
})<Date>();
|
||||
}
|
||||
}
|
||||
var x = new X();
|
||||
return x.m<number, boolean>();
|
||||
}
|
||||
var x = foo<void>();
|
||||
Reference in New Issue
Block a user