Skip to content

Typing for parameterised libraries #1726

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 387 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
387 commits
Select commit Hold shift + click to select a range
a3b7a31
Update bootstrap compiler
lukemaurer Oct 19, 2023
fa251ce
Fix upstream build
lukemaurer Oct 19, 2023
6f86fb9
Disable test of error message
lukemaurer Oct 19, 2023
88b6185
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer Oct 19, 2023
52ea8fd
Revert "Disable test of error message"
lukemaurer Oct 19, 2023
a9eea0b
Fix upstream build
lukemaurer Oct 19, 2023
4f01e24
Merge branch 'layered-persistent_env' into as-argument-for
lukemaurer Oct 19, 2023
3c5b7b5
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer Oct 19, 2023
d619a45
Fix conflicts
lukemaurer Oct 19, 2023
156fd09
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Oct 19, 2023
8b42e26
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Oct 19, 2023
553ff3e
Merge branch 'instance-syntax' into instance-typing
lukemaurer Oct 19, 2023
b4ec625
Normalise test specification
lukemaurer Oct 20, 2023
591a4ec
Generate test specifications
lukemaurer Oct 10, 2023
268ebbd
Test native compilation
lukemaurer Oct 10, 2023
c15dcfb
Ability to add extra variables to actions in `gen_test`
lukemaurer Oct 11, 2023
0a8ee56
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer Oct 20, 2023
a17d34c
Update test generation and add native tests
lukemaurer Oct 20, 2023
70b77ea
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Oct 20, 2023
dc1a3eb
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Oct 20, 2023
b62e6c2
Merge branch 'instance-syntax' into instance-typing
lukemaurer Oct 20, 2023
d051da2
Update test generation and add native tests for instance typing
lukemaurer Oct 20, 2023
294ad42
Merge remote-tracking branch 'upstream/main' into as-parameter
lukemaurer Nov 16, 2023
5518617
Merge remote-tracking branch 'upstream/main' into as-parameter
lukemaurer Nov 16, 2023
77e4338
Merge branch 'as-parameter' into cu-name-is-cmi
lukemaurer Nov 17, 2023
23adeca
Merge branch 'as-parameter' into cu-name-is-cmi
lukemaurer Nov 17, 2023
9234fcd
Bootstrap
lukemaurer Nov 17, 2023
4b2f192
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer Nov 17, 2023
025558c
Remove warning boilerplate from new files
lukemaurer Nov 17, 2023
4c0c8b6
Update `ocaml/.depend`
lukemaurer Nov 17, 2023
f494b9f
Merge branch 'layered-persistent_env' into as-argument-for
lukemaurer Nov 17, 2023
3b8a7f5
Fix a bit of silly back-and-forth
lukemaurer Nov 17, 2023
daaf996
Update tests following rebase
lukemaurer Nov 17, 2023
987a2bd
Partially fix Closure
lukemaurer Nov 17, 2023
2c8ca86
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer Nov 17, 2023
4dd61bb
Merge remote-tracking branch 'upstream/main' into as-parameter
lukemaurer Dec 5, 2023
c67a202
Merge remote-tracking branch 'upstream/main' into as-parameter
lukemaurer Dec 8, 2023
4322629
Use unnamed field instead of double module block
lukemaurer Dec 11, 2023
6d22bc4
Store argument block itself rather than coercion function
lukemaurer Dec 12, 2023
398cc90
Bring in squashed merge of 'as-parameter' branch
lukemaurer Dec 12, 2023
9db2c13
Merge branch 'unsquash/as-parameter' into cu-name-is-cmi
lukemaurer Dec 12, 2023
bf51bd8
Merge remote-tracking branch 'upstream/main' into cu-name-is-cmi
lukemaurer Dec 12, 2023
28654cc
Merge remote-tracking branch 'upstream/main' into unsquash/as-parameter
lukemaurer Dec 12, 2023
f1e32a9
Merge branch 'unsquash/as-parameter' into cu-name-is-cmi
lukemaurer Dec 12, 2023
7d7a241
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer Dec 12, 2023
65e2a92
Fix build of upstream objinfo
lukemaurer Dec 12, 2023
dc7eeaf
Bootstrap
lukemaurer Dec 12, 2023
489b046
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Dec 13, 2023
fa9a22e
Fix upstream build
lukemaurer Dec 13, 2023
ff674e2
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Dec 13, 2023
4cfa38c
Update .depend
lukemaurer Dec 13, 2023
35f2a8b
Merge branch 'instance-syntax' into instance-typing
lukemaurer Dec 13, 2023
92f6810
Fix upstream build
lukemaurer Dec 13, 2023
a4b0c82
Copy new functionality from flambda_backend_objinfo to objinfo
lukemaurer Dec 14, 2023
3cb1126
Code review
lukemaurer Dec 18, 2023
e05a7f5
Code review
lukemaurer Dec 19, 2023
b3be73d
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer Dec 19, 2023
b07af9b
Merge branch 'layered-persistent_env' into as-argument-for
lukemaurer Dec 19, 2023
a277c51
Bootstrap
lukemaurer Dec 19, 2023
73f2689
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer Dec 19, 2023
e94a213
Fix compilation following merge
lukemaurer Dec 19, 2023
5de168d
Bootstrap
lukemaurer Dec 19, 2023
0372eae
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Dec 19, 2023
e8abb3a
Remove code gen changes from `-as-argument-for` branch
lukemaurer Dec 22, 2023
c816563
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer Feb 5, 2024
1cee4f4
Remove code gen changes from 'parameter-parameter' branch
lukemaurer Feb 5, 2024
68e347c
Bootstrap
lukemaurer Feb 5, 2024
814a8a7
Remove more code gen code from 'parameter-parameter' branch
lukemaurer Feb 5, 2024
c36393a
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Feb 5, 2024
95e7772
Generate stub variables for runtime parameters
lukemaurer Feb 7, 2024
abf0b5d
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Feb 7, 2024
068617c
Merge tag 'global-name-is-module-id-with-code-gen' into instance-syntax
lukemaurer Feb 7, 2024
c03a925
Merge tag 'instance-syntax-with-code-gen' into instance-typing
lukemaurer Feb 7, 2024
6e3c291
Regenerate .depend
lukemaurer Feb 7, 2024
7c8d0b5
Fix compilation following merge
lukemaurer Feb 7, 2024
da71d09
Bootstrap following merge
lukemaurer Feb 7, 2024
ab1ea2c
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Feb 7, 2024
f3c613c
Merge branch 'instance-syntax' into instance-typing
lukemaurer Feb 7, 2024
2a33784
Fix formatting
lukemaurer Feb 8, 2024
f68d199
Define `Global.Name.t` in `jane_syntax.mli` to remove dependency
lukemaurer Feb 8, 2024
59dc502
Merge branch 'instance-syntax' into instance-typing
lukemaurer Feb 8, 2024
f0e5033
Fix compilation following merge
lukemaurer Feb 8, 2024
a6a06c5
Fix upstream build: don't let `Global` dep on `Jane_syntax` either
lukemaurer Feb 8, 2024
c3b1667
Merge branch 'instance-syntax' into instance-typing
lukemaurer Feb 8, 2024
635fe93
Promote test changes
lukemaurer Feb 9, 2024
7d6f798
Rename `secondary_interface` to `argument_interface`
lukemaurer Feb 20, 2024
87ab117
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer Feb 20, 2024
a903a9a
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Feb 20, 2024
696b4c9
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Feb 20, 2024
f35e332
Merge branch 'instance-syntax' into instance-typing
lukemaurer Feb 20, 2024
7dab499
Remove stray `cu_runtime_params` reference
lukemaurer Feb 20, 2024
c086a8a
Remove .cmx-related code gen code from 'parameter-parameter' branch
lukemaurer Feb 20, 2024
ee1958b
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Feb 20, 2024
766cfa9
Fix compilation following merge
lukemaurer Feb 20, 2024
48c3576
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Feb 20, 2024
988e8b2
Merge branch 'instance-syntax' into instance-typing
lukemaurer Feb 20, 2024
3b5b143
Remove unused function
lukemaurer Feb 20, 2024
50d0266
Bootstrap
lukemaurer Feb 20, 2024
ccd7064
Overhaul `Import_info` implementation and new API
lukemaurer Apr 30, 2024
c6f988b
Code review
lukemaurer Apr 30, 2024
91c2329
Bootstrap
lukemaurer Apr 30, 2024
8a2b5c2
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer Apr 30, 2024
a3641bb
Compilation fixes following merge
lukemaurer Apr 30, 2024
7e760a1
Copy changes from `asmlink.ml` to `asmlink.ml`
lukemaurer May 1, 2024
014a2d3
Rename a few things for consistency and update comments
lukemaurer May 1, 2024
66fb8b8
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer May 1, 2024
447c2dd
Merge remote-tracking branch 'upstream/main' into cu-name-is-cmi
lukemaurer May 1, 2024
f1be371
Merge branch 'layered-persistent_env' into as-argument-for
lukemaurer May 1, 2024
91b0725
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer May 1, 2024
d701be1
Code review
lukemaurer May 1, 2024
d4cacae
Re-check visibility on _either_ cache hit
lukemaurer May 1, 2024
efd3020
Merge remote-tracking branch 'upstream/main' into cu-name-is-cmi
lukemaurer May 9, 2024
2adb8bd
Rename a few things for code review
lukemaurer May 15, 2024
381a67c
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer May 15, 2024
4ad0aa3
Merge branch 'upstream/main' into layered-persistent_env, up to squas…
lukemaurer May 15, 2024
5af30a5
Bring in squashed merge of 'cu-name-is-cmi' branch
lukemaurer May 15, 2024
f255c62
Merge remote-tracking branch 'upstream/main' into layered-persistent_env
lukemaurer May 15, 2024
6c16e9d
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer May 15, 2024
9fcab53
Merge branch 'layered-persistent_env' into as-argument-for
lukemaurer May 15, 2024
288ed6c
Remove test spec generator
lukemaurer May 15, 2024
5f5a85b
Merge remote-tracking branch 'upstream/main' into instance-library
lukemaurer May 22, 2024
1159e12
Remove now-unused functions from `Misc`
lukemaurer May 22, 2024
531c90c
Have `Global.subst` return whether the input changed
lukemaurer May 22, 2024
1e681ac
Bring in squashed merge of 'layered-persistent_env' branch
lukemaurer May 23, 2024
9dde77e
Rename `global.ml` to `global_module.ml` and move into `typing/`
lukemaurer May 28, 2024
6272975
Improve error messages
lukemaurer May 29, 2024
70a9aa2
Code review
lukemaurer May 29, 2024
2eb82e8
Translate test file ahead of rebase
lukemaurer May 30, 2024
59ea4f9
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer May 30, 2024
81e099e
Fix compilation following merge
lukemaurer May 30, 2024
ec20f9c
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer May 30, 2024
e6904d6
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer May 30, 2024
6733ace
Partially merge remote-tracking branch 'upstream/main' into as-argume…
lukemaurer May 30, 2024
84c9c49
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer May 30, 2024
7398e80
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer May 30, 2024
b87ccc0
Merge branch 'instance-library' into global-name-is-module-id
lukemaurer May 30, 2024
9595527
Restore `Misc.merge_iter` and `Misc.merge_map`
lukemaurer May 30, 2024
a87959b
Merge remote-tracking branch 'upstream/main' into as-argument-for
lukemaurer May 30, 2024
453d7a6
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer May 30, 2024
54637cf
Remove stale dynlink changes left over from 'instance-library' branch
lukemaurer May 30, 2024
4061e54
Add unsquashed 'instance-library' branch as parent
lukemaurer May 30, 2024
c6c696e
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer May 30, 2024
67e7bd9
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer May 30, 2024
dce211c
Fix compilation following merge
lukemaurer May 30, 2024
64802b5
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer May 30, 2024
156aa4d
More awful `dynlink_compilerlibs` fiddling
lukemaurer May 30, 2024
7b4bb09
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer May 30, 2024
4a6781e
Merge branch 'instance-syntax' into instance-typing
lukemaurer Jun 4, 2024
590ea5e
Adapt to new `Global_module.subst` API following merge
lukemaurer Jun 4, 2024
5a8b458
Even more `dynlink` fiddling for my sins
lukemaurer Jun 4, 2024
a9eb21f
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Jun 4, 2024
d0594b1
Merge branch 'instance-syntax' into instance-typing
lukemaurer Jun 4, 2024
33a0476
Put back inadvertently-removed argument label in `Typemod`
lukemaurer Jun 6, 2024
6e596bf
Don't register the argument type as a parameter import
lukemaurer Jun 6, 2024
051fb88
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer Jun 6, 2024
91f658c
Remove concept of unexported parameters
lukemaurer Jun 6, 2024
0ebda3d
Make `param_imports` a `Param_set.t`
lukemaurer Jun 6, 2024
e554cb4
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Jun 6, 2024
3feced2
Small bit of cleanup
lukemaurer Jun 6, 2024
cdc3017
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Jun 6, 2024
4fe7cf7
Remove test generation code (again)
lukemaurer Jun 12, 2024
dddbeaf
Add test for error on `-parameter A` when `A` is not a parameter
lukemaurer Jun 12, 2024
8679b8c
Merge branch 'instance-syntax' into instance-typing
lukemaurer Jun 12, 2024
d9454a7
Adapt to changes in error checking
lukemaurer Jun 12, 2024
4e55d0d
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Jun 12, 2024
420e422
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Jun 12, 2024
cb9b7c8
Merge branch 'instance-syntax' into instance-typing
lukemaurer Jun 12, 2024
5f81383
Remove check on parameters missing from instance names
lukemaurer Jun 12, 2024
de086d2
Merge from 'upstream/main' up to squashed 'as-argument-for' branch
lukemaurer Jun 18, 2024
65376e1
Merge squashed 'as-argument-for' branch from 'upstream/main'
lukemaurer Jun 18, 2024
eb4f173
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Jun 18, 2024
e38400f
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Jun 18, 2024
89416ab
Merge branch 'instance-syntax' into instance-typing
lukemaurer Jun 18, 2024
d04b0d6
Check for malformed instance names with nice error message
lukemaurer Jun 19, 2024
d13b95a
Test for check of repeated arg name
lukemaurer Jun 19, 2024
986c82a
Merge branch 'instance-syntax' into instance-typing
lukemaurer Jun 19, 2024
32ea6ef
Add test for positive case of subset rule
lukemaurer Jun 26, 2024
8466bfa
Bind parameterized modules locally
lukemaurer Jun 26, 2024
042b14d
Fix compilation
lukemaurer Jun 27, 2024
2f3ad28
Update tests to expect local binding of parameterized modules
lukemaurer Jun 27, 2024
79678ae
Update test output to account for missing flambda2 export information
lukemaurer Jun 27, 2024
44400e8
Skip output check for objinfo on .cmx
lukemaurer Jun 27, 2024
649b8e7
Always check for `-as-parameter` on implementation
lukemaurer Jun 28, 2024
1b350b9
Disallow combining `-as-parameter` and `-parameter`
lukemaurer Jun 28, 2024
08a831a
Code review: Improve error message for subset rule
lukemaurer Jul 3, 2024
e1c7627
Code review
lukemaurer Jul 3, 2024
298f477
More code review
lukemaurer Jul 3, 2024
949b7be
Code review: Use, explain "runtime parameters" terminology
lukemaurer Jul 3, 2024
de20fe3
Add a bit more explanation about runtime parameters
lukemaurer Jul 4, 2024
81c50a7
Properly stub out shapes of parameters and parameterised modules
lukemaurer Jul 4, 2024
114ff61
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer Jul 5, 2024
8a860d6
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Jul 5, 2024
e359add
Merge from 'upstream/main' up to squashed 'parameter-parameter' into …
lukemaurer Jul 5, 2024
5ae92d0
Merge squashed 'parameter-parameter' into global-name-is-module-id
lukemaurer Jul 5, 2024
196d358
Merge branch 'instance-syntax' into instance-typing
lukemaurer Jul 5, 2024
37bd46d
Promote test following merge
lukemaurer Jul 5, 2024
6af59c1
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Jul 5, 2024
def8739
Merge remote-tracking branch 'upstream/main' into global-name-is-modu…
lukemaurer Jul 5, 2024
5173c87
Merge remote-tracking branch 'upstream/main' into global-name-is-modu…
lukemaurer Jul 8, 2024
ca4c418
Revert changes to `ocaml/.depend` relative to 'upstream/main'
lukemaurer Jul 9, 2024
e6e922c
Deal with stale upstream references to `Global`
lukemaurer Jul 9, 2024
0f76c03
Punt changes to `Shape`
lukemaurer Jul 9, 2024
227e212
Don't put line breaks in `name`s of idents
lukemaurer Jul 9, 2024
cf2a4a4
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Jul 18, 2024
e2b2da3
Merge remote-tracking branch 'upstream/main' into global-name-is-modu…
lukemaurer Jul 18, 2024
c8b4949
Merge branch 'instance-syntax' into instance-typing
lukemaurer Jul 18, 2024
e7cd6f8
Merge remote-tracking branch 'upstream/main' into global-name-is-modu…
lukemaurer Aug 20, 2024
a843f8f
Introduce record type for instance arguments
lukemaurer Sep 23, 2024
084e460
Code review
lukemaurer Sep 23, 2024
2cb6c92
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Sep 23, 2024
4753683
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Sep 23, 2024
ea3d62e
Merge tag '5.1.1minus-24' into global-name-is-module-id
lukemaurer Sep 24, 2024
1625c02
Merge remote-tracking branch 'upstream/main' into global-name-is-modu…
lukemaurer Sep 25, 2024
86eac6d
Remove accidental copy of `Makefile.compilerlibs`
lukemaurer Sep 25, 2024
e143e8b
Reluctantly fix failure of egregious test
lukemaurer Sep 26, 2024
70ea5f6
Code review
lukemaurer Sep 26, 2024
3d0b5d1
One more change I left out of code review
lukemaurer Sep 26, 2024
3423dac
Merge branch 'instance-syntax' into instance-typing
lukemaurer Sep 27, 2024
ca2da75
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer Sep 27, 2024
4303bb2
Fix compilation following merge
lukemaurer Sep 27, 2024
de4a3f4
Merge 'upstream/main' up to squashed 'global-name-is-module-id' into …
lukemaurer Sep 27, 2024
1946573
Pull squash of 'global-name-is-module-id' into instance-syntax
lukemaurer Sep 27, 2024
972e01c
Merge branch 'instance-syntax' into instance-typing
lukemaurer Sep 27, 2024
dd19fcd
Reintroduce whitespace errors that ocamlformat wants
lukemaurer Sep 27, 2024
60fa615
Update expect tests following merge
lukemaurer Sep 27, 2024
41cc13a
Code review
lukemaurer Sep 30, 2024
b2b3dbc
Clarify stub code
lukemaurer Oct 1, 2024
97266cd
Merge branch 'instance-syntax' into instance-typing
lukemaurer Oct 1, 2024
4d5f29c
Merge 'upstream/main' up to squashed `instance-syntax` into instance-…
lukemaurer Oct 1, 2024
b84ef22
Pull squash of 'instance-syntax' into instance-typing
lukemaurer Oct 1, 2024
3795b6d
Put down the zombie `Makefile.compilerlibs` again
lukemaurer Oct 1, 2024
33b3cf4
Remove anti-instance check that got merged in
lukemaurer Oct 1, 2024
e55943a
Promote expect tests following merge
lukemaurer Oct 1, 2024
4f8e2ce
Add locations to errors raised by `Persistent_env`
lukemaurer Oct 8, 2024
89bce1e
Improve error messages
lukemaurer Oct 8, 2024
edbcb55
Add tests for multi-argument case
lukemaurer Oct 8, 2024
22b6b19
Enable test now that PR #2737 is merged
lukemaurer Oct 8, 2024
8cd5bda
Return mode information from `Env.lookup_module_instance_path`
lukemaurer Oct 17, 2024
ef719c8
Add test of mode checks on instance accesses
lukemaurer Oct 17, 2024
2efb7dd
Code review
lukemaurer Oct 17, 2024
924b5b6
Merge remote-tracking branch 'upstream/main' into instance-typing
lukemaurer Oct 18, 2024
809e0cd
Promote test following rebase
lukemaurer Oct 18, 2024
c101947
Normalise ocamlobjinfo output to fix test in classic mode
lukemaurer Oct 18, 2024
a20b255
Fix test output in classic mode (actually)
lukemaurer Oct 22, 2024
e8b6611
Code review
lukemaurer Oct 23, 2024
72d4e0e
Improvements to error messages
lukemaurer Oct 23, 2024
511d76d
Merge remote-tracking branch 'upstream/main' into instance-typing
lukemaurer Oct 23, 2024
a459ff4
minor adjustment
riaqn Oct 23, 2024
bd1f2d3
Improve comments
lukemaurer Oct 25, 2024
39d68c0
Improve error messages
lukemaurer Oct 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bytecomp/bytelink.ml
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ module Consistbl = Consistbl.Make (CU.Name) (Import_info.Intf.Nonalias.Kind)

let crc_interfaces = Consistbl.create ()
let interfaces = ref ([] : CU.Name.t list)
let implementations_defined = ref ([] : (CU.Name.t * string) list)
let implementations_defined = ref ([] : (CU.t * string) list)

let check_consistency file_name cu =
begin try
let source = List.assoc (CU.name cu.cu_name) !implementations_defined in
let source = List.assoc cu.cu_name !implementations_defined in
raise (Error (Multiple_definition(cu.cu_name, file_name, source)));
with Not_found -> ()
end;
Expand All @@ -213,7 +213,7 @@ let check_consistency file_name cu =
raise(Error(Inconsistent_import(name, user, auth)))
end;
implementations_defined :=
(CU.name cu.cu_name, file_name) :: !implementations_defined
(cu.cu_name, file_name) :: !implementations_defined

let extract_crc_interfaces () =
Consistbl.extract !interfaces crc_interfaces
Expand Down
1 change: 1 addition & 0 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
mode
jkind_types
jkind_intf
signature_with_global_bindings
typedtree
printtyped
ctype
Expand Down
9 changes: 7 additions & 2 deletions file_formats/cmi_format.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,17 @@ type flags = pers_flags list
type header = {
header_name : Compilation_unit.Name.t;
header_kind : kind;
header_globals : Global_module.t array;
header_sign : Serialized.signature;
header_params : Global_module.Name.t list;
header_params : Global_module.t list;
}

type 'sg cmi_infos_generic = {
cmi_name : Compilation_unit.Name.t;
cmi_kind : kind;
cmi_globals : Global_module.t array;
cmi_sign : 'sg;
cmi_params : Global_module.Name.t list;
cmi_params : Global_module.t list;
cmi_crcs : crcs;
cmi_flags : flags;
}
Expand Down Expand Up @@ -125,6 +127,7 @@ let input_cmi_lazy ic =
let {
header_name = name;
header_kind = kind;
header_globals = globals;
header_sign = sign;
header_params = params;
} = (input_value ic : header) in
Expand All @@ -134,6 +137,7 @@ let input_cmi_lazy ic =
{
cmi_name = name;
cmi_kind = kind;
cmi_globals = globals;
cmi_sign = deserialize data sign;
cmi_params = params;
cmi_crcs = crcs;
Expand Down Expand Up @@ -192,6 +196,7 @@ let output_cmi filename oc cmi =
{
header_name = cmi.cmi_name;
header_kind = cmi.cmi_kind;
header_globals = cmi.cmi_globals;
header_sign = sign;
header_params = cmi.cmi_params;
};
Expand Down
3 changes: 2 additions & 1 deletion file_formats/cmi_format.mli
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ type kind =
type 'sg cmi_infos_generic = {
cmi_name : Compilation_unit.Name.t;
cmi_kind : kind;
cmi_globals : Global_module.t array;
cmi_sign : 'sg;
cmi_params : Global_module.Name.t list;
cmi_params : Global_module.t list; (* CR lmaurer: Should be [Parameter_name.t list] *)
cmi_crcs : Import_info.t array;
cmi_flags : pers_flags list;
}
Expand Down
1 change: 1 addition & 0 deletions otherlibs/dynlink/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ COMPILERLIBS_SOURCES=\
typing/typedtree.ml \
typing/btype.ml \
typing/subst.ml \
typing/signature_with_global_bindings.ml \
typing/predef.ml \
typing/datarepr.ml \
file_formats/cmi_format.ml \
Expand Down
7 changes: 7 additions & 0 deletions otherlibs/dynlink/dune
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
lazy_backtrack
zero_alloc_utils
subst
signature_with_global_bindings
predef
datarepr
unit_info
Expand Down Expand Up @@ -300,6 +301,8 @@

(copy_files ../../typing/subst.ml)

(copy_files ../../typing/signature_with_global_bindings.ml)

(copy_files ../../typing/predef.ml)

(copy_files ../../typing/datarepr.ml)
Expand Down Expand Up @@ -456,6 +459,8 @@

(copy_files ../../typing/subst.mli)

(copy_files ../../typing/signature_with_global_bindings.mli)

(copy_files ../../typing/predef.mli)

(copy_files ../../typing/datarepr.mli)
Expand Down Expand Up @@ -606,6 +611,7 @@
.dynlink_compilerlibs.objs/byte/dynlink_compilerlibs__Jkind.cmo
.dynlink_compilerlibs.objs/byte/dynlink_compilerlibs__Btype.cmo
.dynlink_compilerlibs.objs/byte/dynlink_compilerlibs__Subst.cmo
.dynlink_compilerlibs.objs/byte/dynlink_compilerlibs__Signature_with_global_bindings.cmo
.dynlink_compilerlibs.objs/byte/dynlink_compilerlibs__Bytesections.cmo
.dynlink_compilerlibs.objs/byte/dynlink_compilerlibs__Cmi_format.cmo
.dynlink_compilerlibs.objs/byte/dynlink_compilerlibs__Debuginfo.cmo
Expand Down Expand Up @@ -703,6 +709,7 @@
.dynlink_compilerlibs.objs/native/dynlink_compilerlibs__Jkind.cmx
.dynlink_compilerlibs.objs/native/dynlink_compilerlibs__Btype.cmx
.dynlink_compilerlibs.objs/native/dynlink_compilerlibs__Subst.cmx
.dynlink_compilerlibs.objs/native/dynlink_compilerlibs__Signature_with_global_bindings.cmx
.dynlink_compilerlibs.objs/native/dynlink_compilerlibs__Bytesections.cmx
.dynlink_compilerlibs.objs/native/dynlink_compilerlibs__Cmi_format.cmx
.dynlink_compilerlibs.objs/native/dynlink_compilerlibs__Debuginfo.cmx
Expand Down
4 changes: 3 additions & 1 deletion testsuite/tests/packs/inconsistent/main.compilers.reference
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
File "main.ml", line 1:
File "main.ml", line 28, characters 11-30:
28 | module _ = Use_member_directly
^^^^^^^^^^^^^^^^^^^
Error: The file subdir/use_member_directly.cmi
is imported both as "Pack.Member" and as "Member".
8 changes: 4 additions & 4 deletions testsuite/tests/parsetree/source_jane_street.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1005,10 +1005,10 @@ module Value1 : sig end
module Value2 : sig end -> sig end -> sig end
module Name2_1 : sig end
module Name2_1 : sig end
>> Fatal error: Unimplemented: instance identifier
Base[Name1:Value1][Name2:Value2[Name2_1:Value2_1]]
Uncaught exception: Misc.Fatal_error

Line 9, characters 11-64:
9 | module _ = Base(Name1)(Value1)(Name2)(Value2(Name2_1)(Value2_1)) [@jane.non_erasable.instances]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound module "Base[Name1:Value1][Name2:Value2[Name2_1:Value2_1]]"
|}](*********)
(* modes *)

Expand Down
2 changes: 2 additions & 0 deletions testsuite/tests/self-contained-toplevel/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ let () =
cmi_kind;
cmi_params;
cmi_sign;
cmi_globals;
cmi_crcs;
cmi_flags
} =
Expand All @@ -41,6 +42,7 @@ let () =
cmi_kind;
cmi_params;
cmi_sign = Subst.Lazy.of_signature cmi_sign;
cmi_globals;
cmi_crcs;
cmi_flags
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module Monoid_utils_of_banana =
Monoid_utils(Banana)(List_monoid) [@jane.non_erasable.instances]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
File "bad_instance_arg_name_not_found.ml", line 2, characters 2-35:
2 | Monoid_utils(Banana)(List_monoid) [@jane.non_erasable.instances]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: The module "Monoid_utils" has no parameter "Banana".
Hint: Parameters for "Monoid_utils": "Monoid"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module Monoid_utils_of_int =
Monoid_utils(Monoid)(Monoid_utils(Monoid)(List_monoid)) [@jane.non_erasable.instances]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
File "bad_instance_arg_value_not_arg.ml", line 2, characters 2-57:
2 | Monoid_utils(Monoid)(Monoid_utils(Monoid)(List_monoid)) [@jane.non_erasable.instances]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: The module "Monoid_utils[Monoid:List_monoid]"
cannot be used as an argument for parameter "Monoid".
Hint: Compile "monoid_utils.cmi" with "-as-argument-for Monoid".
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module Monoid_utils_of_int =
Monoid_utils(Monoid)(Banana) [@jane.non_erasable.instances]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
File "bad_instance_arg_value_not_found.ml", line 2, characters 2-30:
2 | Monoid_utils(Monoid)(Banana) [@jane.non_erasable.instances]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound module "Banana" in instance "Monoid_utils[Monoid:Banana]"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module Category_utils_of_list_monoid =
Category_utils(Category)(List_monoid) [@jane.non_erasable.instances]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
File "bad_instance_arg_value_wrong_type.ml", line 2, characters 2-39:
2 | Category_utils(Category)(List_monoid) [@jane.non_erasable.instances]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: The module "List_monoid"
is used as an argument for the parameter "Category" but "List_monoid"
is an argument for "Monoid".
Hint: "list_monoid.cmi" was compiled with "-as-argument-for Category".
5 changes: 5 additions & 0 deletions testsuite/tests/templates/basic/bad_instance_wrong_mode.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let (f @ portable) () =
let module Monoid_utils_of_list_monoid =
Monoid_utils(Monoid)(List_monoid) [@jane.non_erasable.instances]
in
()
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
File "bad_instance_wrong_mode.ml", line 3, characters 4-37:
3 | Monoid_utils(Monoid)(List_monoid) [@jane.non_erasable.instances]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Modules are nonportable, so cannot be used inside a function that is portable.
9 changes: 6 additions & 3 deletions testsuite/tests/templates/basic/bad_param_not_param.reference
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
File "bad_param_not_param.mli", line 1:
Error: The module "Widget" is specified as a parameter, but "widget.cmi"
was not compiled with -as-parameter.
File "bad_param_not_param.mli", line 19, characters 17-25:
19 | val frobnicate : Widget.t -> Widget.t
^^^^^^^^
Error: The module "Widget"
is a parameter but is not declared as such for the current unit.
Hint: Compile the current unit with "-parameter Widget".
9 changes: 6 additions & 3 deletions testsuite/tests/templates/basic/bad_ref_direct.reference
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
File "bad_ref_direct.ml", line 1:
Error: The file "monoid.cmi" contains the interface of a parameter.
"Monoid" is not declared as a parameter for the current unit (-parameter "Monoid").
File "bad_ref_direct.ml", line 3, characters 12-21:
3 | let empty = Monoid.id
^^^^^^^^^
Error: The file "monoid.cmi" contains the interface of a parameter. "Monoid"
is not declared as a parameter for the current unit.
Hint: Compile the current unit with "-parameter Monoid".
7 changes: 7 additions & 0 deletions testsuite/tests/templates/basic/bad_ref_direct_imported.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(* [Monoid] is not a parameter of this, but it _is_ imported because it's used
as a parameter *)

module Monoid_utils_of_semigroup =
Monoid_utils(Monoid)(Monoid_of_semigroup) [@jane.non_erasable.instances]

let empty = Monoid.empty
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
File "bad_ref_direct_imported.ml", line 7, characters 12-24:
7 | let empty = Monoid.empty
^^^^^^^^^^^^
Error: The file "monoid.cmi" contains the interface of a parameter. "Monoid"
is not declared as a parameter for the current unit.
Hint: Compile the current unit with "-parameter Monoid".
6 changes: 4 additions & 2 deletions testsuite/tests/templates/basic/bad_ref_indirect.reference
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
File "bad_ref_indirect.ml", line 1:
File "bad_ref_indirect.ml", line 2, characters 13-32:
2 | let concat = Monoid_utils.concat
^^^^^^^^^^^^^^^^^^^
Error: The module "Monoid_utils" is not accessible because it takes "Monoid"
as a parameter and the current unit does not.
Hint: Pass `-parameter "Monoid"` to add "Monoid" as a parameter
Hint: Pass "-parameter Monoid" to add "Monoid" as a parameter
of the current unit.
1 change: 1 addition & 0 deletions testsuite/tests/templates/basic/category.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include Category_intf.S
1 change: 1 addition & 0 deletions testsuite/tests/templates/basic/category_b.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include Category_intf.S
1 change: 1 addition & 0 deletions testsuite/tests/templates/basic/category_b_of_category.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include Category
1 change: 1 addition & 0 deletions testsuite/tests/templates/basic/category_b_of_category.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include Category_intf.S with type ('a, 'b) t = ('a, 'b) Category.t
6 changes: 6 additions & 0 deletions testsuite/tests/templates/basic/category_intf.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module type S = sig
type ('a, 'b) t

val id : ('a, 'a) t
val compose : first:('a, 'b) t -> second:('b, 'c) t -> ('a, 'c) t
end
6 changes: 6 additions & 0 deletions testsuite/tests/templates/basic/category_of_monoid.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type ('a, 'b) t = Monoid.t

let id = Monoid.empty
let compose ~first ~second = Monoid.append first second

let as_unit t = t
8 changes: 8 additions & 0 deletions testsuite/tests/templates/basic/category_of_monoid.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type ('a, 'b) t = Monoid.t

val id : ('a, 'a) t
val compose : first:('a, 'b) t -> second:('b, 'c) t -> ('a, 'c) t

(* Demonstrate that we can have extra functions beyond what's required by the
.mli for the parameter type *)
val as_unit : (_, _) t -> (unit, unit) t
5 changes: 5 additions & 0 deletions testsuite/tests/templates/basic/category_utils.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let rec concat : type a b. (a, b) Chain.t -> (a, b) Category.t =
fun chain ->
match chain with
| [] -> Category.id
| a_to_b :: b_to_c -> Category.compose ~first:a_to_b ~second:(concat b_to_c)
1 change: 1 addition & 0 deletions testsuite/tests/templates/basic/category_utils.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
val concat : ('a, 'b) Chain.t -> ('a, 'b) Category.t
3 changes: 3 additions & 0 deletions testsuite/tests/templates/basic/chain.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type (_, _) t =
| [] : ('a, 'a) t
| (::) : ('a, 'b) Category.t * ('b, 'c) t -> ('a, 'c) t
3 changes: 3 additions & 0 deletions testsuite/tests/templates/basic/chain.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type (_, _) t =
| [] : ('a, 'a) t
| (::) : ('a, 'b) Category.t * ('b, 'c) t -> ('a, 'c) t
7 changes: 7 additions & 0 deletions testsuite/tests/templates/basic/import.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Chain_of_semigroup =
Chain(Category)(Category_of_monoid(Monoid)(Monoid_of_semigroup))
[@jane.non_erasable.instances]

module Chain_of_lists =
Chain(Category)(Category_of_monoid(Monoid)(List_monoid))
[@jane.non_erasable.instances]
15 changes: 15 additions & 0 deletions testsuite/tests/templates/basic/import_multi_arg.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Category_of_semigroup_and_lists =
Product_category
(Category)(Category_of_monoid(Monoid)(Monoid_of_semigroup))
(Category_b)(Category_b_of_category
(Category)(Category_of_monoid(Monoid)(List_monoid)))
[@jane.non_erasable.instances]

module Chain_of_semigroup_and_lists =
Chain
(Category)
(Product_category
(Category)(Category_of_monoid(Monoid)(Monoid_of_semigroup))
(Category_b)(Category_b_of_category
(Category)(Category_of_monoid(Monoid)(List_monoid))))
[@jane.non_erasable.instances]
1 change: 1 addition & 0 deletions testsuite/tests/templates/basic/list_element.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type t
4 changes: 4 additions & 0 deletions testsuite/tests/templates/basic/list_monoid.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type t = List_element.t list

let empty = []
let append = List.append
4 changes: 4 additions & 0 deletions testsuite/tests/templates/basic/list_monoid.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type t = List_element.t list

val empty : t
val append : t -> t -> t
27 changes: 27 additions & 0 deletions testsuite/tests/templates/basic/main.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module Monoid_utils_of_semigroup =
Monoid_utils(Monoid)(Monoid_of_semigroup) [@jane.non_erasable.instances]

module Category_utils_of_semigroup =
Category_utils(Category)(Category_of_monoid(Monoid)(Monoid_of_semigroup))
[@jane.non_erasable.instances]

module Category_utils_of_list =
Category_utils(Category)(Category_of_monoid(Monoid)(List_monoid))
[@jane.non_erasable.instances]

module Category_of_list_monoid =
Category_of_monoid(Monoid)(List_monoid)
[@jane.non_erasable.instances]

let concat_semi : Monoid_utils_of_semigroup.ts -> Monoid_of_semigroup.t =
Monoid_utils_of_semigroup.concat

let concat_chain_semi = Category_utils_of_semigroup.concat

let append3_semi a b c = Category_utils_of_semigroup.concat [ a; b; c ]

let concat_lists = List.concat

let concat_chain_lists = Category_utils_of_list.concat

let append3_lists a b c = concat_chain_lists [ a; b; c ]
19 changes: 19 additions & 0 deletions testsuite/tests/templates/basic/main.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
open Import

val append3_semi
: Semigroup.t option
-> Semigroup.t option
-> Semigroup.t option
-> Semigroup.t option

val concat_semi : Semigroup.t option list -> Monoid_of_semigroup.t

val concat_chain_semi
: (unit, unit) Chain_of_semigroup.t -> Monoid_of_semigroup.t

val append3_lists
: List_monoid.t -> List_monoid.t -> List_monoid.t -> List_monoid.t

val concat_lists : List_monoid.t list -> List_element.t list

val concat_chain_lists : (_, _) Chain_of_lists.t -> List_element.t list
Loading
Loading