Opened 15 years ago
Last modified 14 years ago
#1445 closed defect (fixed)
Stack overflow when importing function into same scope
| Reported by: | Per Östlund | Owned by: | Per Östlund |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Instantiation | Version: | trunk |
| Keywords: | Cc: | Per Östlund, |
Description
The following model causes a stack overflow:
package P
import P2 = P;
function f
output Real r = 2.0;
end f;
constant Real c = P2.f();
end P;
The reason for this is that when instantiating the constant c it tries to look up the function P2.f. The lookup then tries to instantiate the package P when it looks for f, which causes it to instantiate c, etc.
Change History (2)
comment:1 by , 15 years ago
comment:2 by , 14 years ago
Fixed since SCodeFlatten is now on by default. Test case added in revision 8881.
Note:
See TracTickets
for help on using tickets.

Works with scodeFlatten