dillon1000/react
Commit
Browse files Type inference across function expressions boundaries
Updates InferTypes to perform type inference across function boundaries. Specifically InferTypes is now responsible for driving type inference of function expressions (rather than deferring to AnalyzeFunctions to infer functions), and type inference now traverses into function expressions and infers types of free variables taking into account information from the outer context. This relies on the fact that identifier ids are consistent across function expression boundaries and that all free variables in functions are guaranteed to be effectively `const`, since we promote non-const variables used in function expressions to context variables.
Changed paths7 files
First-parent comparisoncompiler/forget/packages/babel-plugin-react-forget/src/HIR/PrintHIR.ts ModifiedM compiler/forget/packages/babel-plugin-react-forget/src/SSA/EnterSSA.ts ModifiedM compiler/forget/packages/babel-plugin-react-forget/src/TypeInference/InferTypes.ts ModifiedM compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-at-closure.expect.md ModifiedR compiler/forget/src/__tests__/fixtures/compiler/context-variable-reassigned-outside-of-lambda.expect.md →compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/context-variable-reassigned-outside-of-lambda.expect.md RenamedR compiler/forget/src/__tests__/fixtures/compiler/context-variable-reassigned-outside-of-lambda.js →compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/context-variable-reassigned-outside-of-lambda.js RenamedM compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/destructuring-mixed-scope-declarations-and-locals.expect.md ModifiedPatch
Files changed
Rendering syntax-highlighted changes…