View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
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 | ||||||
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. | ||||||||
Attached Files |
|