-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Description
TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms:
Code
class a{
test() {
t();
function t(this: a) {
}
}
}
class b{
test(this:b) {
t();
function t(this: b) {
}
}
}Expected behavior:
No Error
Actual behavior:
'this' context of type 'void' is not assignable to method's 'this' of type '***' when call funtion t
Playground Link:
http://www.typescriptlang.org/play/index.html#src=class%20a%7B%0D%0A%20%20%20%20test()%20%7B%0D%0A%20%20%20%20%20%20%20%20t()%3B%0D%0A%20%20%20%20%20%20%20%20function%20t(this%3A%20a)%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0Aclass%20b%7B%0D%0A%20%20%20%20test(this%3Ab)%20%7B%0D%0A%20%20%20%20%20%20%20%20t()%3B%0D%0A%20%20%20%20%20%20%20%20function%20t(this%3A%20b)%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%7D
Related Issues: