Feature Requests: Browse | Submit New | Admin

[#16907] Better differentiation between array types when inferring types

Date:
2008-01-07 20:51
Priority:
3
Submitted By:
Chris OMeara (comeara)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Better differentiation between array types when inferring types

Detailed description
I spent quite a bit of time today tracking down problems related to overloaded constructors in my RJB project.  It appears
RJB considers any array in a constructor signature as simply an array hence does not distinguish between arrays of different
types when selecting which constructor it will invoke.  Further, the selection of the constructor seems to vary platform
to platform.  Colleagues working on Linux saw a different constructor invoked than I did on Mac OS X.

I'll attach an example illustrating the issue to this ticket.  In the example, notice the following constructors:

  public Widget (PartA[] aParts) {
    this.aParts = aParts;
  }

  public Widget (PartB[] bParts) {
    this.bParts = bParts;
  }

From what I can tell, unless I explicitly specify which constructor I want using new_with_sig, there's no guarantee
which constructor will be called.

Ideally, I'd like a stronger type check which selects the correct constructor based on the contents of the array.

If a stronger type check is impossible, I'd be happy with a warning or exception letting me know I requested an ambiguous
operation.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2008-01-08 19:23
Sender: arton Tajima

Your request is reasonable. I'll try to fix it.

Attached Files:

Name Description Download
rjb_interface_enhancement.zip Example illustrating the problem Download

Changes:

Field Old Value Date By
File Added3067: rjb_interface_enhancement.zip2008-01-07 20:51comeara