Opened 13 years ago

Closed 6 years ago

#1486 closed defect (fixed)

The compiler accepts illegal connections

Reported by: sjoelund.se Owned by: perost
Priority: critical Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc: sjoelund.se, perost

Description

This should *not* work (only connector classes may be connected):

class A
  Real x,y=1;
equation
  connect(x,y);
end A;

Change History (13)

comment:1 Changed 11 years ago by sjoelund.se

  • Component set to Frontend
  • Milestone set to 1.9.0

comment:2 Changed 11 years ago by sjoelund.se

  • Milestone changed from 1.9.0 to 1.9.1

Postponed until 1.9.1

comment:3 Changed 10 years ago by sjoelund.se

  • Owner changed from sjoelund.se to perost
  • Status changed from new to assigned

comment:4 Changed 10 years ago by sjoelund.se

  • Milestone changed from 1.9.1 to 1.9.2

This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).

comment:5 Changed 10 years ago by sjoelund.se

  • Milestone changed from 1.9.2 to 1.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:6 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.3 to 1.9.4

Moved to new milestone 1.9.4

comment:7 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.5

Milestone pushed to 1.9.5

comment:8 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.5 to 1.10.0

Milestone renamed

comment:9 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.10.0 to 1.11.0

Ticket retargeted after milestone closed

comment:10 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.11.0 to 1.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:11 Changed 7 years ago by casella

  • Milestone changed from 1.12.0 to 1.13.0
  • Priority changed from high to critical

With the new front end in OMC v1.13.0-dev-148-g3532b10, I get:

1] 23:22:10 Symbolic Error
Too few equations, under-determined system. 
The model has 1 equation(s) and 2 variable(s).

[2] 23:22:10 Symbolic Warning
Variable x does not have any remaining equation to be solved in.
  The original equations were:

This is really not good. The Modelica Specification, section 9.1, states:
"The connect-equation construct takes two references to connectors..."

If any of the two references in the connect statement is not a connector, a specific error should be issued, it makes no sense to continue further with the back-end.

comment:12 Changed 6 years ago by casella

  • Component changed from Frontend to New Instantiation
  • Milestone changed from 1.13.0 to 2.0.0

As of 1.13.0, the new front-end produces this error

[1] 14:44:28 Translation Error
[A: 4:3-4:15]: x is not a valid connector.

This will be the default behaviour in 2.0.0

comment:13 Changed 6 years ago by casella

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.