Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Generics    [ Add a report in this area ]  
Report #:  107458   Status: Closed
Type inference from open array constructors
Project:  Delphi Build #:  17.0.4625.53395
Version:    17.0 Submitted By:   Blaise Thorn
Report Type:  Basic functionality failure Date Reported:  7/27/2012 3:11:23 PM
Severity:    Infrequently encountered problem Last Updated: 4/15/2014 6:47:24 PM
Platform:    All platforms Internal Tracking #:   30547
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE6
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 35
Description
... only works if OVERLOAD is specified. That should not be a requirement.

Tags: E2010
Steps to Reproduce:
// Compile this test, notice a bogus E2010. Uncomment OVERLOAD, and now the test gets compiled.

uses TypInfo;

type C = class

procedure Test<T>(const A: array of T);  //OVERLOAD;
end;

procedure C.Test<T>(const A: array of T);
begin

writeln( PTypeInfo(TypeInfo(T)).Name );
end;

var
X, Y: Integer;
begin
{$AppType Console}

C.Create.Test( [X, Y] )

// ^-- E2010 Incompatible types: 'T' and 'Integer'
end.
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01