* Bind alias ThisProperty assignment declarations This is a quick prototype that does the wrong thing at the wrong time with the wrong technique. * Preliminary checker handling for aliases Duplicative and untested, but I think I updated all the places that need updating. * new is error; old one should not have been removed * I don't even know what's happening with this test * cleanup and testing in the checker * binder: use lookupSymbolForNameWorker instead of mutable This should have about the same behaviour and is much easier to understand. Also refactor common code a bit. * Shorter name of lookupSymbolForName Once upon a time there was a parent/worker function, but now it's just a single function again. No need for the -Worker suffix. * remove oodate comment * fix switch-case-break lint * Refactor and move functions * Rename and improve type of getContextualTypeForAssignmentDeclaration
24 lines
407 B
TypeScript
24 lines
407 B
TypeScript
// @noEmit: true
|
|
// @allowJs: true
|
|
// @checkJs: true
|
|
// @noImplicitAny: true
|
|
// @strictNullChecks: true
|
|
// @Filename: inferringClassMembersFromAssignments7.js
|
|
class C {
|
|
constructor() {
|
|
var self = this
|
|
self.x = 1
|
|
self.m = function() {
|
|
console.log(self.x)
|
|
}
|
|
}
|
|
mreal() {
|
|
var self = this
|
|
self.y = 2
|
|
}
|
|
}
|
|
const c = new C()
|
|
c.x
|
|
c.y
|
|
c.m()
|