Opened 11 years ago
Last modified 7 years ago
#3121 assigned defect
Wrong behaviour of operator overloading example — at Version 1
| Reported by: | anonymous | Owned by: | Mahder Alemseged Gebremedhin |
|---|---|---|---|
| Priority: | low | Milestone: | 2.1.0 |
| Component: | New Instantiation | Version: | trunk |
| Keywords: | Cc: |
Description (last modified by )
This model contains errors (in operator "+" inputs should be a BugRecord type).
Trace is attached.
model Bug operator record BugRecord Integer x; operator function '+' input Bug b1; input Bug b2; output BugRecord rec(x = b1.x + b2.x); end '+'; end BugRecord; BugRecord bugRecord = BugRecord(1) + BugRecord(0); end Bug;
Change History (2)
by , 11 years ago
comment:1 by , 8 years ago
| Component: | *unknown* → NF - New FrontEnd |
|---|---|
| Description: | modified (diff) |
| Owner: | changed from to |
| Status: | new → assigned |
| Summary: | Stack overflow in operator → Wrong behaviour of operator overloading example |
Note:
See TracTickets
for help on using tickets.

OMEdit still crashes with this test case as of OpenModelica-v1.13.0-dev-63-g453e1c7-64bit. It doesn't crash with the new frontend
-d=newInst, but it still doesn't compile, because the code is probably wrong. If the reporter meant this model instead:model Bug operator record BugRecord Integer x; encapsulated operator function '+' input BugRecord b1; input BugRecord b2; output BugRecord rec(x = b1.x + b2.x); algorithm annotation(Inline = true); end '+'; end BugRecord; BugRecord bugRecord = BugRecord(1) + BugRecord(0); end Bug;in fact we still have a problem even with the new front-end, which reports
For the record, Dymola simulates this updated model correctly.