Skip to content

Lexical scope for constraining clause of encapsulated class? #3814

@JM-KANE

Description

@JM-KANE
model Test
  replaceable encapsulated model A
    Real x = 1;
    Real y = 1;
  end A constrainedby C(x = y);  // C and y cannot be looked up in the enclosing scope?
  replaceable encapsulated model B = C /* illegal base class */ constrainedby C(x = y);
  
  model C
    Real x = 0;
  end C;  
  A a;
  B b;
  Real y = 2;
end Test;

in 4.6.1, encapsulated short class introduce an additional lexical scope for modifiers, will this also apply to constraining clause? And what about encapsulated long class?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions