-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usage: spec compliant name lookup of uses in parameter initializer
Also fixes lookup of types that are shadowed inside the function body. Fixes: #40
- Loading branch information
Showing
4 changed files
with
67 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,37 @@ | ||
let bar, baz, bas, p1, p2, p3; | ||
~~~ [Unused] | ||
~~~ [Unused] | ||
~~ [Unused] | ||
~~ [Unused] | ||
~~ [Unused] | ||
function fn(foo: typeof bar, bar: typeof baz, baz: typeof bas, p1 = p2, p2 = 2, p3 = 3, p4 = p3, p5: typeof quux) { | ||
~~~ [Unused] | ||
~~ [Unused] | ||
~~ [Unused] | ||
~~ [Unused] | ||
~~ [Unused] | ||
let bas: boolean; | ||
~~~ [Unused] | ||
var quux: string; | ||
~~~~ [Unused] | ||
} | ||
|
||
function fn2(foo: typeof bar) { | ||
function fn2(foo: typeof bar): typeof bar { | ||
~~~ [Unused] | ||
let bas: number; | ||
var bar: typeof bas; | ||
~~~ [Unused] | ||
} | ||
|
||
let foo: number; | ||
~~~ [Unused] | ||
function fn3({foo}: {foo: string}): typeof foo { | ||
} | ||
|
||
type T = string; | ||
|
||
function fn4(param: T) { | ||
type T = number; | ||
~ [Unused] | ||
return param; | ||
} | ||
|
||
export {fn, fn2}; | ||
export {fn, fn2, fn3, fn4}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters