Opened 3 years ago

Closed 3 years ago

Last modified 3 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 perost)

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 follow-up: Changed 3 years ago by perost

  • 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 follow-up: Changed 3 years ago by casella

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

comment:3 in reply to: ↑ 1 Changed 3 years ago by anonymous

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.

comment:4 in reply to: ↑ 2 ; follow-up: Changed 3 years ago by 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)

comment:5 in reply to: ↑ 4 Changed 3 years ago by perost

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 Changed 3 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:7 Changed 3 years ago by phannebohm

  • Component changed from *unknown* to Frontend

comment:8 Changed 3 years ago by casella

  • Milestone changed from 1.16.1 to 1.16.0
Note: See TracTickets for help on using tickets.