fix lookup regression again (#26762)

* fix lookup regression again

* add test case
This commit is contained in:
Wenlu Wang
2018-08-30 23:48:49 +08:00
committed by Nathan Shively-Sanders
parent c327ab40bc
commit 038f665171
11 changed files with 46 additions and 6 deletions

View File

@@ -1212,7 +1212,7 @@ namespace ts {
}
if (meaning & SymbolFlags.Value && result.flags & SymbolFlags.Variable) {
// expression inside parameter will lookup as normal variable scope when targeting es2015+
if (compilerOptions.target && compilerOptions.target >= ScriptTarget.ES2015 && isParameter(lastLocation) && !isParameterPropertyDeclaration(lastLocation) && result.valueDeclaration !== lastLocation) {
if (compilerOptions.target && compilerOptions.target >= ScriptTarget.ES2015 && isParameter(lastLocation) && !isParameterPropertyDeclaration(lastLocation) && result.valueDeclaration.pos > lastLocation.end) {
useResult = false;
}
else if (result.flags & SymbolFlags.FunctionScopedVariable) {