dillon1000/react
Commit
Browse files [tests][hir-typer] Add hir-tests fixture
--- Currently, we run type inference passes early in the pipeline and do not check inference output in any tests, test fixtures, or verifier passes. In fact, the only ways to view inferred types are (1) locally add a test fixture with`@only` and inspect console logs or (2) scroll to the relevant section on a playground example. However, inferred types and effects significantly affect the output of later passes (Alias / MutableRange analysis, InferReactiveIdentifiers, etc), and we have already found some bugs due to incorrect inference (e.g. #1274). This PR add the `typer-tests` fixture with the following goals 1. Record relevant current compiler type + effect inference output. 2. Have relatively stable output (with respect to changes in HIR and PrintHIR). - we try to achieve this by annotating the source code.
Changed paths7 files
First-parent comparisoncompiler/forget/src/__tests__/compiler-test.ts ModifiedA compiler/forget/src/__tests__/fixtures/hir/simple-array.expect.md AddedA compiler/forget/src/__tests__/fixtures/hir/simple-array.js AddedA compiler/forget/src/__tests__/fixtures/hir/simple-object.expect.md AddedA compiler/forget/src/__tests__/fixtures/hir/simple-object.js AddedA compiler/forget/src/__tests__/hir-test.ts AddedM compiler/forget/src/__tests__/test-utils/generateTestsFromFixtures.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…