Opened 11 years ago

Closed 7 years ago

Last modified 7 years ago

#2296 closed defect (fixed)

Checks for protected elements

Reported by: Martin Sjölund Owned by: Per Östlund
Priority: critical Milestone: 2.0.0
Component: New Instantiation Version: trunk
Keywords: Cc:

Description

We currently allow access of protected elements that should not be possible to access. This is very important for bootstrapping since dependency analysis depends on protected elements not being part of the interface of an encapsulated package.

encapsulated package P
protected
  constant Real c = 1.0;
  function f output Real c = 1.0; end f;
end P;

encapsulated model M
  import P;
  Real r1 = P.c; // illegal
  Real r2 = P.f(); // illegal
end M;

Change History (10)

comment:1 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:2 by Adrian Pop, 9 years ago

Priority: blockercritical

comment:3 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:4 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:5 by Martin Sjölund, 8 years ago

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:6 by Martin Sjölund, 8 years ago

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:7 by Francesco Casella, 7 years ago

Component: FrontendNew Instantiation
Milestone: 1.12.02.0.0
Owner: changed from somebody to Per Östlund
Status: newassigned

As of v1.13.0-dev-188-g2c5818d with -d=newInst, the access to P.c is correctly detected as illegal. However the following model

encapsulated model M
  import P;
  // Real r1 = P.c; // illegal
  Real r2 = P.f(); // illegal
end M;

fails with error messages which seem related to an incomplete implementation of functions in the new front-end, but not because of attemped access to a protected element.

comment:8 by Per Östlund, 7 years ago

Resolution: fixed
Status: assignedclosed

Fixed in 691f4e9.

comment:9 by Jan Kokert, 7 years ago

Just a shot follow-up: Is ticket #4346 related with this one? Thanks!

in reply to:  9 comment:10 by Per Östlund, 7 years ago

Replying to janK:

Just a shot follow-up: Is ticket #4346 related with this one? Thanks!

Not really, that looks like a separate issue.

Note: See TracTickets for help on using tickets.