modelica / Modelica-Compliance

A semantics compliance suite for the Modelica language
Other
17 stars 16 forks source link

In ModelicaCompliance.Operators.Overloading.ConstructorPriority, the call to the default constructor would be invalid anyway. #64

Open qlambert-pro opened 5 years ago

qlambert-pro commented 5 years ago

This test verifies that the overloaded constructor shadows the automatically generated constructor. The call to the constructor uses a single positional argument. This makes the potential call to the default constructor invalid. Therefore, the ambiguity is lifted by there being a single valid constructor.

I suggest we move the default binding from re to im:

Integer re;
Integer im = 1;

instead of:

Integer re = 1;
Integer im;

In this case, both calls are valid, and we test that the overloaded constructor properly shadows the automatically generated one.