69 lines
2.9 KiB
Text
69 lines
2.9 KiB
Text
=== tests/cases/conformance/expressions/contextualTyping/superCallParameterContextualTyping3.ts ===
|
|
interface ContextualType<T> {
|
|
>ContextualType : Symbol(ContextualType, Decl(superCallParameterContextualTyping3.ts, 0, 0))
|
|
>T : Symbol(T, Decl(superCallParameterContextualTyping3.ts, 0, 25))
|
|
|
|
method(parameter: T): void;
|
|
>method : Symbol(method, Decl(superCallParameterContextualTyping3.ts, 0, 29))
|
|
>parameter : Symbol(parameter, Decl(superCallParameterContextualTyping3.ts, 1, 11))
|
|
>T : Symbol(T, Decl(superCallParameterContextualTyping3.ts, 0, 25))
|
|
}
|
|
|
|
class CBase<T> {
|
|
>CBase : Symbol(CBase, Decl(superCallParameterContextualTyping3.ts, 2, 1))
|
|
>T : Symbol(T, Decl(superCallParameterContextualTyping3.ts, 4, 12))
|
|
|
|
constructor(param: ContextualType<T>) {
|
|
>param : Symbol(param, Decl(superCallParameterContextualTyping3.ts, 5, 16))
|
|
>ContextualType : Symbol(ContextualType, Decl(superCallParameterContextualTyping3.ts, 0, 0))
|
|
>T : Symbol(T, Decl(superCallParameterContextualTyping3.ts, 4, 12))
|
|
}
|
|
|
|
foo(param: ContextualType<T>) {
|
|
>foo : Symbol(foo, Decl(superCallParameterContextualTyping3.ts, 6, 5))
|
|
>param : Symbol(param, Decl(superCallParameterContextualTyping3.ts, 8, 8))
|
|
>ContextualType : Symbol(ContextualType, Decl(superCallParameterContextualTyping3.ts, 0, 0))
|
|
>T : Symbol(T, Decl(superCallParameterContextualTyping3.ts, 4, 12))
|
|
}
|
|
}
|
|
|
|
class C extends CBase<string> {
|
|
>C : Symbol(C, Decl(superCallParameterContextualTyping3.ts, 10, 1))
|
|
>CBase : Symbol(CBase, Decl(superCallParameterContextualTyping3.ts, 2, 1))
|
|
|
|
constructor() {
|
|
// Should be okay.
|
|
// 'p' should have type 'string'.
|
|
super({
|
|
>super : Symbol(CBase, Decl(superCallParameterContextualTyping3.ts, 2, 1))
|
|
|
|
method(p) {
|
|
>method : Symbol(method, Decl(superCallParameterContextualTyping3.ts, 16, 15))
|
|
>p : Symbol(p, Decl(superCallParameterContextualTyping3.ts, 17, 19))
|
|
|
|
p.length;
|
|
>p.length : Symbol(String.length, Decl(lib.d.ts, 414, 19))
|
|
>p : Symbol(p, Decl(superCallParameterContextualTyping3.ts, 17, 19))
|
|
>length : Symbol(String.length, Decl(lib.d.ts, 414, 19))
|
|
}
|
|
});
|
|
|
|
// Should be okay.
|
|
// 'p' should have type 'string'.
|
|
super.foo({
|
|
>super.foo : Symbol(CBase.foo, Decl(superCallParameterContextualTyping3.ts, 6, 5))
|
|
>super : Symbol(CBase, Decl(superCallParameterContextualTyping3.ts, 2, 1))
|
|
>foo : Symbol(CBase.foo, Decl(superCallParameterContextualTyping3.ts, 6, 5))
|
|
|
|
method(p) {
|
|
>method : Symbol(method, Decl(superCallParameterContextualTyping3.ts, 24, 19))
|
|
>p : Symbol(p, Decl(superCallParameterContextualTyping3.ts, 25, 19))
|
|
|
|
p.length;
|
|
>p.length : Symbol(String.length, Decl(lib.d.ts, 414, 19))
|
|
>p : Symbol(p, Decl(superCallParameterContextualTyping3.ts, 25, 19))
|
|
>length : Symbol(String.length, Decl(lib.d.ts, 414, 19))
|
|
}
|
|
});
|
|
}
|
|
}
|