47 lines
1.4 KiB
Text
47 lines
1.4 KiB
Text
=== tests/cases/conformance/types/thisType/fluentClasses.ts ===
|
|
class A {
|
|
>A : Symbol(A, Decl(fluentClasses.ts, 0, 0))
|
|
|
|
foo() {
|
|
>foo : Symbol(A.foo, Decl(fluentClasses.ts, 0, 9))
|
|
|
|
return this;
|
|
>this : Symbol(A, Decl(fluentClasses.ts, 0, 0))
|
|
}
|
|
}
|
|
class B extends A {
|
|
>B : Symbol(B, Decl(fluentClasses.ts, 4, 1))
|
|
>A : Symbol(A, Decl(fluentClasses.ts, 0, 0))
|
|
|
|
bar() {
|
|
>bar : Symbol(B.bar, Decl(fluentClasses.ts, 5, 19))
|
|
|
|
return this;
|
|
>this : Symbol(B, Decl(fluentClasses.ts, 4, 1))
|
|
}
|
|
}
|
|
class C extends B {
|
|
>C : Symbol(C, Decl(fluentClasses.ts, 9, 1))
|
|
>B : Symbol(B, Decl(fluentClasses.ts, 4, 1))
|
|
|
|
baz() {
|
|
>baz : Symbol(C.baz, Decl(fluentClasses.ts, 10, 19))
|
|
|
|
return this;
|
|
>this : Symbol(C, Decl(fluentClasses.ts, 9, 1))
|
|
}
|
|
}
|
|
var c: C;
|
|
>c : Symbol(c, Decl(fluentClasses.ts, 15, 3))
|
|
>C : Symbol(C, Decl(fluentClasses.ts, 9, 1))
|
|
|
|
var z = c.foo().bar().baz(); // Fluent pattern
|
|
>z : Symbol(z, Decl(fluentClasses.ts, 16, 3))
|
|
>c.foo().bar().baz : Symbol(C.baz, Decl(fluentClasses.ts, 10, 19))
|
|
>c.foo().bar : Symbol(B.bar, Decl(fluentClasses.ts, 5, 19))
|
|
>c.foo : Symbol(A.foo, Decl(fluentClasses.ts, 0, 9))
|
|
>c : Symbol(c, Decl(fluentClasses.ts, 15, 3))
|
|
>foo : Symbol(A.foo, Decl(fluentClasses.ts, 0, 9))
|
|
>bar : Symbol(B.bar, Decl(fluentClasses.ts, 5, 19))
|
|
>baz : Symbol(C.baz, Decl(fluentClasses.ts, 10, 19))
|
|
|