Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#6180 closed defect (fixed)

Nested records which seek to assign values between each other now fail to compile

Reported by: craig.fletcher@… Owned by: somebody
Priority: high Milestone: 1.16.0
Component: Frontend Version: v1.16.0-dev
Keywords: Cc:

Description (last modified by Per Östlund)

Sample code follows below. This code compiles in previous releases of OMC.

model DebugI
  record InnerA
    Integer c = 2;
  end InnerA;

  record InnerB
    Integer c;
  end InnerB;

  record BaseRecord
    InnerA inner_a;
    Integer d = inner_a.c;          //...this works
    InnerB inner_b (c = inner_a.c); //...this fails to compile
  end BaseRecord;

  BaseRecord base;
end DebugI;

Change History (8)

comment:1 by Per Östlund, 4 years ago

Description: modified (diff)

I'm afraid I can't replicate the issue, the model compiles and simulates without any errors for me. Can you be more specific on what goes wrong?

comment:2 by Francesco Casella, 4 years ago

@craig.fletcher, are you using the new front end (default from OMEdit, needs -d=newInst from scripts)?

in reply to:  1 comment:3 by anonymous, 4 years ago

Replying to perost:

I'm afraid I can't replicate the issue, the model compiles and simulates without any errors for me. Can you be more specific on what goes wrong?

I'll re-confirm the code and come back to you with details.

in reply to:  2 ; comment:4 by anonymous, 4 years ago

Replying to casella:

@craig.fletcher, are you using the new front end (default from OMEdit, needs -d=newInst from scripts)?

No, compiling from the command line. (Linux)

in reply to:  4 comment:5 by Per Östlund, 4 years ago

Replying to anonymous:

Replying to casella:

@craig.fletcher, are you using the new front end (default from OMEdit, needs -d=newInst from scripts)?

No, compiling from the command line. (Linux)

Then you need to add the -d=newInst flag to use the new frontend, the old one has some issues with record constructors in this case. The new frontend will be the default also on the command line in the next major release.

comment:6 by anonymous, 4 years ago

Resolution: fixed
Status: newclosed

We've confirmed here that building with the -d=newInst switch works fine. Thanks all!

comment:7 by Philip Hannebohm, 4 years ago

Component: *unknown*Frontend

comment:8 by Francesco Casella, 4 years ago

Milestone: 1.16.11.16.0
Note: See TracTickets for help on using tickets.