TypeScript/tests/baselines/reference/optionalConstructorArgInSuper.types

31 lines
1.3 KiB
Text
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/optionalConstructorArgInSuper.ts ===
class Base {
2015-04-13 23:01:57 +02:00
>Base : Base, Symbol(Base, Decl(optionalConstructorArgInSuper.ts, 0, 0))
2014-08-15 23:33:16 +02:00
constructor(opt?) { }
2015-04-13 23:01:57 +02:00
>opt : any, Symbol(opt, Decl(optionalConstructorArgInSuper.ts, 1, 16))
2014-08-15 23:33:16 +02:00
foo(other?) { }
2015-04-13 23:01:57 +02:00
>foo : (other?: any) => void, Symbol(foo, Decl(optionalConstructorArgInSuper.ts, 1, 25))
>other : any, Symbol(other, Decl(optionalConstructorArgInSuper.ts, 2, 8))
2014-08-15 23:33:16 +02:00
}
class Derived extends Base {
2015-04-13 23:01:57 +02:00
>Derived : Derived, Symbol(Derived, Decl(optionalConstructorArgInSuper.ts, 3, 1))
>Base : Base, Symbol(Base, Decl(optionalConstructorArgInSuper.ts, 0, 0))
2014-08-15 23:33:16 +02:00
}
var d = new Derived(); // bug caused an error here, couldn't select overload
2015-04-13 23:01:57 +02:00
>d : Derived, Symbol(d, Decl(optionalConstructorArgInSuper.ts, 6, 3))
2014-08-15 23:33:16 +02:00
>new Derived() : Derived
2015-04-13 23:01:57 +02:00
>Derived : typeof Derived, Symbol(Derived, Decl(optionalConstructorArgInSuper.ts, 3, 1))
2014-08-15 23:33:16 +02:00
var d2: Derived;
2015-04-13 23:01:57 +02:00
>d2 : Derived, Symbol(d2, Decl(optionalConstructorArgInSuper.ts, 7, 3))
>Derived : Derived, Symbol(Derived, Decl(optionalConstructorArgInSuper.ts, 3, 1))
2014-08-15 23:33:16 +02:00
d2.foo();
>d2.foo() : void
2015-04-13 23:01:57 +02:00
>d2.foo : (other?: any) => void, Symbol(Base.foo, Decl(optionalConstructorArgInSuper.ts, 1, 25))
>d2 : Derived, Symbol(d2, Decl(optionalConstructorArgInSuper.ts, 7, 3))
>foo : (other?: any) => void, Symbol(Base.foo, Decl(optionalConstructorArgInSuper.ts, 1, 25))
2014-08-15 23:33:16 +02:00