2024-05-15 18:33 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000026mercuryBugpublic2008-09-03 16:11
Reporterwangp 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000026: problem with inst for abstract type
DescriptionI'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.
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0000049

juliensf (administrator)

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.

~0000050

juliensf (administrator)

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.)

~0000111

wangp (developer)

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*.

~0000112

juliensf (administrator)

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.

~0000125

wangp (developer)

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).

~0000146

wangp (developer)

Sort of fixed.
+Notes

-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
+Issue History