Mercury Bugs - mercury | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0000086 | mercury | Bug | public | 2008-09-29 11:05 | 2015-11-02 13:08 |
Reporter | user90 | ||||
---|---|---|---|---|---|
Assigned To | juliensf | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0000086: Uncaught mode error leads to crash in codegen.m | ||||
Description | The following program: %-----------------------------------------------------------------------------% :- module hello. :- interface. :- import_module io. :- pred main(io::di, io::uo) is det. :- implementation. :- import_module string. :- type abc ---> a ; b ; c. :- inst ab ---> a ; b. :- func abc2ab(abc::in) = (abc::out(ab)) is det. abc2ab(X) = X. main(!IO) :- X = abc2ab(c), io.write_string("X = " ++ X^string, !IO). %-----------------------------------------------------------------------------% Makes the compiler abort: Uncaught Mercury exception: Software Error: code_gen.m: Unexpected: semidet model in det context Stack dump not available in this grade. A similar case: if I change 'main' to this: main(!IO) :- X = abc2ab(c), ( X = a, io.write_string("X = a: " ++ X^string, !IO) ; X = b, io.write_string("X = b: " ++ X^string, !IO) ; X = c, io.write_string("X = c: " ++ X^string, !IO) ). I get a compiler warning: hello.m:029: In clause for `main(di, uo)': hello.m:029: warning: unification of `X' and hello.c cannot succeed hello.m:029: `X' has instantiatedness `bound((hello.a) ; (hello.b))'. and then codegen.m aborts again -- I guess the 'X=c' branch is removed as dead code. | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files |
Notes | |||||
|
|||||
|
|
Issue History | |||||
Date Modified | Username | Field | Change | ||
---|---|---|---|---|---|
2008-09-29 11:05 | New Issue | ||||
2015-11-02 13:08 | juliensf | Note Added: 0000860 | |||
2015-11-02 13:08 | juliensf | Status | new => resolved | ||
2015-11-02 13:08 | juliensf | Resolution | open => fixed | ||
2015-11-02 13:08 | juliensf | Assigned To | => juliensf |