Modelica-Compliance icon indicating copy to clipboard operation
Modelica-Compliance copied to clipboard

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

Open qlambert-pro opened this issue 7 years ago • 0 comments

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.

qlambert-pro avatar Jan 07 '19 07:01 qlambert-pro