Commit 0f8eef5
authored
fix: Elaborate the source body in
* fix: getFileEnv elaborates the file body, not just imports
`getFileEnv` ran only `processHeaderCore`, so the returned environment
held the file's imports but none of its own definitions. As a result
`ix compile foo.lean` produced an env without foo's constants, and
`--only-const <name>` over the resulting `.ixe` could not resolve any
name defined in the source file (e.g. `myReflEq` in MinimalDefs).
Run the body through `IO.processCommands` (as `runFrontend` does) so the
environment includes the file's definitions. Also fixes `ix validate`
and `ix ingress`, which share `getFileEnv`.
* test: guard that getFileEnv loads the file body, not just imports
Adds `Tests.Ix.EnvBody`, run in the default suite: it loads the existing
`Tests/Ix/Fixtures/Export.lean` fixture via `getFileEnv` and asserts its
body definition (`inductive MyNat`) is present, alongside an imported
constant (`Nat`). The body assertion is red under the header-only
regression and green with the body-elaboration fix.getFileEnv (#456)1 parent 62e0a0f commit 0f8eef5
3 files changed
Lines changed: 48 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
147 | 152 | | |
148 | 153 | | |
149 | 154 | | |
| |||
0 commit comments