-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
By DesignDeprecated - use "Working as Intended" or "Design Limitation" insteadDeprecated - use "Working as Intended" or "Design Limitation" instead
Description
Hi,
VS: 2013 Update 4
TS: 1.3
Here's some code that compiles correctly:
class Base {
foo() {
return this;
}
}
class Derived extends Base {
foo() {
return super.foo();
}
}
Here's some other code that fails:
class Base2 {
foo() {
return this;
}
}
class Derived2 extends Base2 {
// 'foo' implicitly has return type 'any' because it does not have a
// return type annotation and is referenced directly or indirectly in
// one of its return expressions.
foo() {
return <Derived2> super.foo();
}
}
I'm aware that a bug with implicit-any and recursive methods has been fixed, but to me it's pretty clear that the return value for Derived2.foo
is Derived2
.
Metadata
Metadata
Assignees
Labels
By DesignDeprecated - use "Working as Intended" or "Design Limitation" insteadDeprecated - use "Working as Intended" or "Design Limitation" instead