Repository navigation
Commit b354825
Keep the module type comparison around a permutation of its fields
Why:
Codex review of #9140: when two module types have the same fields in
another order, the innermost symptom is the permutation, which shows no
declarations, and leaving out the module type comparison around it left
only "Illegal permutation of structure fields". A comparison is now left
out only when a later symptom shows the declarations that differ.
The parser gave a module type declaration in a signature no location,
unlike one in a structure, so the expected side printed without a
position. It now spans from the name to the end, as in a structure.
Diagnostic modified (fields of a module type in another order):
Example:
module M: {
module type T = {
let a: int
let b: int
}
} = {
module type T = {
let b: int
let a: int
}
}
Before (diagnostic):
Signature mismatch:
In module type T:
Illegal permutation of structure fields
After (diagnostic):
Signature mismatch:
Actual declaration (include_modtype_permutation.res:7:15-10:3):
module type T = {
let b: int
let a: int
}
Expected declaration (include_modtype_permutation.res:2:15-5:3):
module type T = {
let a: int
let b: int
}
In module type T:
Illegal permutation of structure fields
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gLpf7RN1MiRcubPgRn
Signed-off-by: Christoph Knittel <ck@cca.io>1 parent e819c19 commit b354825
3 files changed
Lines changed: 33 additions & 3 deletions
File tree
- compiler
- ml
- syntax/src
- tests/build_tests/super_errors/expected
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
684 | 695 | | |
685 | 696 | | |
686 | | - | |
687 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
688 | 700 | | |
689 | 701 | | |
690 | 702 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7244 | 7244 | | |
7245 | 7245 | | |
7246 | 7246 | | |
| 7247 | + | |
7247 | 7248 | | |
7248 | 7249 | | |
7249 | 7250 | | |
| |||
7265 | 7266 | | |
7266 | 7267 | | |
7267 | 7268 | | |
7268 | | - | |
| 7269 | + | |
| 7270 | + | |
| 7271 | + | |
| 7272 | + | |
| 7273 | + | |
| 7274 | + | |
7269 | 7275 | | |
7270 | 7276 | | |
7271 | 7277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
16 | 28 | | |
17 | 29 | | |
18 | 30 | | |
0 commit comments