View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000521 | mercury | Bug | public | 2020-09-29 17:23 | 2022-01-25 01:24 | ||||
Reporter | dirkz | ||||||||
Assigned To | zs | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Platform | Mercury 20.06 | OS | macOS Catalina | OS Version | 10.15.7 | ||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000521: Missing error message about an 'undefined type'; misleading error message instead | ||||||||
Description | The compiler should clearly complain about an 'undefined type'. Expected error message: thing_def.m:17 error: undefined type `list'/1. Actual error message: main.m:033: In clause for predicate `get_wrapped_things'/1: main.m:033: in argument 1 of functor `list_wrapper/1': main.m:033: type error in unification of argument main.m:033: and constant `get_things'. main.m:033: argument has type `list.list(thing_def.thing)', main.m:033: constant `get_things' has type `list(thing_def.thing)'. For more information, recompile with `-E'. | ||||||||
Steps To Reproduce | mmc --make main | ||||||||
Additional Information | Attached example: Module thing_def.m declares this function without importing the list module: :- func get_things = list(thing). Not importing the list module is the actual problem. But the compiler does not complain about the missing import. Instead it issues a misleading error message. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
|
Notes | |
zs (developer) 2020-10-08 16:10 |
I just added code to compiler to complain about the missing import. It should be in the next ROTD. You still get the misleading error message, but you also get a non-misleading pointer to where the error is. The error should really be diagnosed when the compiler makes the interface file for the module with the missing import. The compiler has had an option named --print-errors-warnings-when-generating-interface for a while now which does exactly that, but for now, it is not turned on by default, because it is part of a bigger set of changes that are not complete yet. However, if you are willing to live with an experimental-for-now feature, you can enable it manually. |
dirkz (reporter) 2020-10-12 05:15 |
Thank you for fixing the error message. I just performed a successful test with rotd-2020-10-09 on MacOS High Sierra 10.13.6. |
zs (developer) 2022-01-25 01:24 |
The compiler has been diagnosing such errors when making interface files for some time now. |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2020-09-29 17:23 | dirkz | New Issue | |
2020-09-29 17:23 | dirkz | File Added: example.tgz | |
2020-10-08 16:04 | zs | Assigned To | => zs |
2020-10-08 16:04 | zs | Status | new => assigned |
2020-10-08 16:10 | zs | Note Added: 0001108 | |
2020-10-12 05:15 | dirkz | Note Added: 0001111 | |
2022-01-25 01:24 | zs | Status | assigned => resolved |
2022-01-25 01:24 | zs | Resolution | open => fixed |
2022-01-25 01:24 | zs | Note Added: 0001159 |