Ticket #166 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Report ambiguities in cases of optional lowering

Reported by: stephan Owned by: stephan
Priority: minor Milestone: OTDT_1.3.0_M3
Component: language Version: 1.2.4
Keywords: Cc:

Description

In a role R bound to base B I had a constructor

protected R(R other) {
   base(...);
}

Now any role creation with an R argument

R r1 = ...
R r2 = new R(r1);

was ambiguous: in addition to the explicit constructor given above the implicit lifting constructor (R(B b)) was applicable by implicitly lowering the argument r1.

B.1.1-otjld-sh-70 gives a witness where actually the lifting constructor is chosen, because the explicit constructor has insufficient visibility.

The compiler should report something here, but also the OTJLD should mention something to which the warnings/errors could refer.

Change History

Changed 3 years ago by stephan

r19250 implements a preliminary warning regarding lowering of a constructor arg.

A more general solution is still pending.

Changed 3 years ago by stephan

  • milestone set to OTDT_1.3.0

Changed 3 years ago by stephan

  • status changed from new to closed
  • resolution set to fixed

At a closer look no further action is required because selection among several methods will simply follow standard java rules as to pick the most specific method, which in this case will be a method that doesn't require argument lowering.

Only the case of an implicit constructor hiding an explicit one is worth signaling, as implemented in r19250.

Also note the difference between this issue and ticket #256.

Changed 3 years ago by stephan

  • milestone changed from OTDT_1.3.0 to OTDT_1.3.0_M3

Changed 3 years ago by stephan

  • priority changed from major to minor
Note: See TracTickets for help on using tickets.