#3633 closed defect (fixed)
Returning from a non-returning match generates bad code
Reported by: | Per Östlund | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | normal | Milestone: | 1.9.4 |
Component: | MetaModelica | Version: | |
Keywords: | Cc: |
Description
Running this script:
setCommandLineOptions("-g=MetaModelica"); loadString(" function test input Integer n; algorithm _ := match n local Integer x; case 1 algorithm x := n; then x; end match; end test; "); test(1); getErrorString();
causes the code generation to generate the line:
= (modelica_integer)_n;
The expected behaviour is that the compiler gives an error when trying to return x from the case, since the match is declared to not return anything.
Change History (4)
comment:1 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 9 years ago
Milestone: | Future → 1.9.4 |
---|
Sorting these closed tickets away from "Future". Since they were closed after the last 1.9.3 release, it's very likely that they should have been part of the 1.9.4 release.
Note:
See TracTickets
for help on using tickets.
Fixed in 8c9025a. I was wrong in saying an error should be generated, the code should in fact work (but won't do anything).