Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//// [typeParameterDoesntBlockParameterLookup.ts]
declare function f<Foo extends Bar, Bar>(Bar: any): void

//// [typeParameterDoesntBlockParameterLookup.js]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=== tests/cases/compiler/typeParameterDoesntBlockParameterLookup.ts ===
declare function f<Foo extends Bar, Bar>(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))

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
=== tests/cases/compiler/typeParameterDoesntBlockParameterLookup.ts ===
declare function f<Foo extends Bar, Bar>(Bar: any): void
>f : <Foo extends Bar, Bar>(Bar: any) => void
>Bar : any

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare function f<Foo extends Bar, Bar>(Bar: any): void