Opened 14 years ago

Closed 6 years ago

#1486 closed defect (fixed)

The compiler accepts illegal connections

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

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 by Martin Sjölund, 12 years ago

Component: Frontend
Milestone: 1.9.0

comment:2 by Martin Sjölund, 11 years ago

Milestone: 1.9.01.9.1

Postponed until 1.9.1

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

Owner: changed from Martin Sjölund to Per Östlund
Status: newassigned

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

Milestone: 1.9.11.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 by Martin Sjölund, 10 years ago

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

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

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

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

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

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

Milestone: 1.9.51.10.0

Milestone renamed

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

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:10 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:11 by Francesco Casella, 7 years ago

Milestone: 1.12.01.13.0
Priority: highcritical

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 by Francesco Casella, 6 years ago

Component: FrontendNew Instantiation
Milestone: 1.13.02.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 by Francesco Casella, 6 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.