Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler/checker: type check shown files with a different type checker
This change type checks the shown files with a new type checker, that creates a clean "type checking environment" that is then discarded. This fixes the bug #660 that was caused by an invalid value of 'tc.ancestors' (it was inherited from the type checking of the "outer" file) that made 'tc.currentFunction' (and consequently 'isUpVar') return wrong results. Using a new type checker (that is discarded after checking the shown file) is now possible because the type infos have been moved inside the 'compilation', so they are not lost even if the type checker is deleted. This change may also avoids some other similar problems. Fix #660.
- Loading branch information