Skip to content

Adds support for looking up past Blocks in expando objects #38031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 29, 2020

Conversation

orta
Copy link
Contributor

@orta orta commented Apr 17, 2020

Fixes #31972

The Block in the AST stops the the lookup for the symbol in the containing scope for the expando function, this PR makes the symbol lookup fallback to checking the blockscope scope when needed as well

/cc @andrewbranch

@sandersn
Copy link
Member

Doesn't this only fail to work in TS? Can you add a test for JS as well and see whether it fails without your fix?

@orta
Copy link
Contributor Author

orta commented Apr 22, 2020

Confirmed this fails in JS in the current playground, and double confirmed that it fixes it on that side too

// Creates a type { first:string, last: string }
/**
 * @typedef {Object} Human - creates a new type named 'SpecialType'
 * @property {string} first - a string property of SpecialType
 * @property...

Playground Link

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try with just blockScopeContainer and check that things fail without both? I'd also like to see the updated baselines before signing off.

@orta
Copy link
Contributor Author

orta commented Apr 24, 2020

This should be good for a second look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function with properties type inferred only at top level
5 participants