60 lines
2.2 KiB
Text
60 lines
2.2 KiB
Text
=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterAsTypeArgument.ts ===
|
|
// These are all errors because type parameters cannot reference other type parameters from the same list
|
|
|
|
function foo<T, U>(x: T, y: U) {
|
|
>foo : Symbol(foo, Decl(typeParameterAsTypeArgument.ts, 0, 0))
|
|
>T : Symbol(T, Decl(typeParameterAsTypeArgument.ts, 2, 13))
|
|
>U : Symbol(U, Decl(typeParameterAsTypeArgument.ts, 2, 15))
|
|
>x : Symbol(x, Decl(typeParameterAsTypeArgument.ts, 2, 19))
|
|
>T : Symbol(T, Decl(typeParameterAsTypeArgument.ts, 2, 13))
|
|
>y : Symbol(y, Decl(typeParameterAsTypeArgument.ts, 2, 24))
|
|
>U : Symbol(U, Decl(typeParameterAsTypeArgument.ts, 2, 15))
|
|
|
|
foo<U, U>(y, y);
|
|
>foo : Symbol(foo, Decl(typeParameterAsTypeArgument.ts, 0, 0))
|
|
>U : Symbol(U, Decl(typeParameterAsTypeArgument.ts, 2, 15))
|
|
>U : Symbol(U, Decl(typeParameterAsTypeArgument.ts, 2, 15))
|
|
>y : Symbol(y, Decl(typeParameterAsTypeArgument.ts, 2, 24))
|
|
>y : Symbol(y, Decl(typeParameterAsTypeArgument.ts, 2, 24))
|
|
|
|
return new C<U,T>();
|
|
>C : Symbol(C, Decl(typeParameterAsTypeArgument.ts, 5, 1))
|
|
>U : Symbol(U, Decl(typeParameterAsTypeArgument.ts, 2, 15))
|
|
>T : Symbol(T, Decl(typeParameterAsTypeArgument.ts, 2, 13))
|
|
}
|
|
|
|
class C<T, U> {
|
|
>C : Symbol(C, Decl(typeParameterAsTypeArgument.ts, 5, 1))
|
|
>T : Symbol(T, Decl(typeParameterAsTypeArgument.ts, 7, 8))
|
|
>U : Symbol(U, Decl(typeParameterAsTypeArgument.ts, 7, 10))
|
|
|
|
x: T;
|
|
>x : Symbol(x, Decl(typeParameterAsTypeArgument.ts, 7, 15))
|
|
>T : Symbol(T, Decl(typeParameterAsTypeArgument.ts, 7, 8))
|
|
}
|
|
|
|
interface I<T, U> {
|
|
>I : Symbol(I, Decl(typeParameterAsTypeArgument.ts, 9, 1))
|
|
>T : Symbol(T, Decl(typeParameterAsTypeArgument.ts, 11, 12))
|
|
>U : Symbol(U, Decl(typeParameterAsTypeArgument.ts, 11, 14))
|
|
|
|
x: C<U, T>;
|
|
>x : Symbol(x, Decl(typeParameterAsTypeArgument.ts, 11, 19))
|
|
>C : Symbol(C, Decl(typeParameterAsTypeArgument.ts, 5, 1))
|
|
>U : Symbol(U, Decl(typeParameterAsTypeArgument.ts, 11, 14))
|
|
>T : Symbol(T, Decl(typeParameterAsTypeArgument.ts, 11, 12))
|
|
}
|
|
|
|
//function foo<T, U extends T>(x: T, y: U) {
|
|
// foo<U, U>(y, y);
|
|
// return new C<U, T>();
|
|
//}
|
|
|
|
//class C<T extends U, U> {
|
|
// x: T;
|
|
//}
|
|
|
|
//interface I<T, U extends T> {
|
|
// x: C<U, T>;
|
|
//}
|
|
|