diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 611b6c4d4b075..07e82eac0a64b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1231,7 +1231,7 @@ namespace ts { // local types not visible outside the function body : false; } - if (meaning & SymbolFlags.Value && result.flags & SymbolFlags.FunctionScopedVariable) { + if (meaning & result.flags & SymbolFlags.FunctionScopedVariable) { // parameters are visible only inside function body, parameter list and return type // technically for parameter list case here we might mix parameters and variables declared in function, // however it is detected separately when checking initializers of parameters diff --git a/tests/baselines/reference/typeParameterDoesntBlockParameterLookup.js b/tests/baselines/reference/typeParameterDoesntBlockParameterLookup.js new file mode 100644 index 0000000000000..90f1a1f4a379b --- /dev/null +++ b/tests/baselines/reference/typeParameterDoesntBlockParameterLookup.js @@ -0,0 +1,4 @@ +//// [typeParameterDoesntBlockParameterLookup.ts] +declare function f(Bar: any): void + +//// [typeParameterDoesntBlockParameterLookup.js] diff --git a/tests/baselines/reference/typeParameterDoesntBlockParameterLookup.symbols b/tests/baselines/reference/typeParameterDoesntBlockParameterLookup.symbols new file mode 100644 index 0000000000000..8c98b05e2ddcc --- /dev/null +++ b/tests/baselines/reference/typeParameterDoesntBlockParameterLookup.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/typeParameterDoesntBlockParameterLookup.ts === +declare function f(Bar: any): void +>f : Symbol(f, Decl(typeParameterDoesntBlockParameterLookup.ts, 0, 0)) +>Foo : Symbol(Foo, Decl(typeParameterDoesntBlockParameterLookup.ts, 0, 19)) +>Bar : Symbol(Bar, Decl(typeParameterDoesntBlockParameterLookup.ts, 0, 35), Decl(typeParameterDoesntBlockParameterLookup.ts, 0, 41)) +>Bar : Symbol(Bar, Decl(typeParameterDoesntBlockParameterLookup.ts, 0, 35), Decl(typeParameterDoesntBlockParameterLookup.ts, 0, 41)) +>Bar : Symbol(Bar, Decl(typeParameterDoesntBlockParameterLookup.ts, 0, 35), Decl(typeParameterDoesntBlockParameterLookup.ts, 0, 41)) + diff --git a/tests/baselines/reference/typeParameterDoesntBlockParameterLookup.types b/tests/baselines/reference/typeParameterDoesntBlockParameterLookup.types new file mode 100644 index 0000000000000..7edcbde437379 --- /dev/null +++ b/tests/baselines/reference/typeParameterDoesntBlockParameterLookup.types @@ -0,0 +1,5 @@ +=== tests/cases/compiler/typeParameterDoesntBlockParameterLookup.ts === +declare function f(Bar: any): void +>f : (Bar: any) => void +>Bar : any + diff --git a/tests/cases/compiler/typeParameterDoesntBlockParameterLookup.ts b/tests/cases/compiler/typeParameterDoesntBlockParameterLookup.ts new file mode 100644 index 0000000000000..20db312369029 --- /dev/null +++ b/tests/cases/compiler/typeParameterDoesntBlockParameterLookup.ts @@ -0,0 +1 @@ +declare function f(Bar: any): void \ No newline at end of file