Repository navigation
Commit edaf802
JIT: an import pointing to a .ts file is included with its bodies (#404)
* An import pointing to a .ts file includes it with its bodies
mlirGenInclude generated an imported .ts module as declarations only, so a
program run on its own (tslang main.ts, JIT) found no bodies for what it
imported: 'Symbols not found: [ S..new ]' for new S() of an imported class.
An import pointing to a .ts file now includes it with its bodies, like a
referenced file; one pointing to a library (lib<name>.so / <name>.dll) still
takes them from the library. A .d.ts stays declarations only.
Known: test-runner still compiles each imported module into an object of its
own and links it beside the importer, so the multi-module export-import,
reference-path, shared-class-members and import-bindings tests now fail with
'multiple definition' link errors until the runner stops doing that.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VPAHhg8c9NEdoYNw52AtTg
* test-runner -jit -shared: the imported library is loaded by the import, not --shared-libs
A library an `import` points to is loaded by the program at run time; passing
it with --shared-libs as well is not how it is meant to be used (and matches
the Windows runner, which already did not). The 56 test-jit-shared tests pass,
including the reference-path diamond/cycle and shared-class-members ones.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VPAHhg8c9NEdoYNw52AtTg
* Compiled, an import pointing to a .ts file is a declaration; under the JIT it is included
Compiled, each .ts module is an object of its own and the objects are linked
into one program, so an import pointing to a .ts file only declares what the
module has. Under the JIT there is no other object: the file is included with
its bodies. The import-source test now also runs compiled, with the module's
object linked beside the program.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VPAHhg8c9NEdoYNw52AtTg
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6e76af1 commit edaf802
5 files changed
Lines changed: 30 additions & 2 deletions
File tree
- tslang
- lib/TypeScript
- test/tester
- import-source
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1089 | 1094 | | |
1090 | | - | |
| 1095 | + | |
1091 | 1096 | | |
1092 | 1097 | | |
1093 | 1098 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2622 | 2622 | | |
2623 | 2623 | | |
2624 | 2624 | | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
2625 | 2632 | | |
2626 | 2633 | | |
2627 | 2634 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
| 689 | + | |
| 690 | + | |
690 | 691 | | |
691 | 692 | | |
692 | 693 | | |
| |||
0 commit comments