View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000026 | mercury | Bug | public | 2007-11-12 12:48 | 2008-09-03 16:11 | ||||
Reporter | wangp | ||||||||
Assigned To | |||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000026: problem with inst for abstract type | ||||||||
Description | I'm not sure if this code should even be allowed, but the compiler aborts with the message: Software Error: code_gen.m: Unexpected: semidet model in det context The problem is something like this. In rdfDiffStore.iterate_search there is a switch on WrappedStore. Simplification prunes the switch cases which it knows won't be taken due to the inst of WrappedStore. When the types rdfStore.open and rdfStore.transact are abstract, the instmap entry for WrappedStore says that it is bound to either unqualified(open) or unqualified(transact). These don't match rdfStore.open and rdfStore.transact, so all the switch cases are deleted, turning it into a `fail'. When rdfStore.open and rdfStore.transact are non-abstract, then the instmap entry for WrappedStore are properly module qualified so the switch is not incorrectly pruned. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
|
Notes | |
juliensf (administrator) 2007-11-12 17:39 |
It isn't clear to me what the correct thing to do here is. If we had abstract insts then this sort of code shouldn't be allowed, but as it is the relationship between abstract types and exported insts is a bit fuzzy (to say the least). It may be possible to tweak module qualification to allow this to "work", but I think a proper fix for it is going to have to wait until the mode analyser is redone. |
juliensf (administrator) 2007-11-13 13:44 |
The reason it doesn't work is that the body of the abstract type is not included in the interface files. The importing module, rdfDiffStore, therefore cannot qualify the inst properly. Note, that this example will work with --intermodule-optimization enabled (because the bodies of the abstract types are included in the optimization interfaces.) |
wangp (developer) 2008-08-05 13:18 |
The same problem has struck again. What to do to prevent this? Issue an error for abstract types with exported insts? Even if we might support it in the future, it's not supported *now*. |
juliensf (administrator) 2008-08-05 13:24 |
If it is causing problems then issuing some sort of warning would be a good idea. I'm not sure how easy that would be to implement though. |
wangp (developer) 2008-08-08 15:14 |
Added a warning about it, although it won't necessarily be issued in time to stop confusing the user (the warning code isn't run when making .int files). |
wangp (developer) 2008-09-03 16:11 |
Sort of fixed. |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2007-11-12 12:48 | wangp | New Issue | |
2007-11-12 12:48 | wangp | File Added: rdfDiffStore.m | |
2007-11-12 12:49 | wangp | File Added: rdfStore.m | |
2007-11-12 17:39 | juliensf | Note Added: 0000049 | |
2007-11-12 17:39 | juliensf | Status | new => feedback |
2007-11-13 13:44 | juliensf | Note Added: 0000050 | |
2008-08-05 13:18 | wangp | Note Added: 0000111 | |
2008-08-05 13:24 | juliensf | Note Added: 0000112 | |
2008-08-08 15:14 | wangp | Note Added: 0000125 | |
2008-09-03 16:11 | wangp | Status | feedback => closed |
2008-09-03 16:11 | wangp | Note Added: 0000146 | |
2008-09-03 16:11 | wangp | Resolution | open => fixed |