View Issue Details

IDProjectCategoryView StatusLast Update
0025596FPCCompilerpublic2015-01-06 14:40
ReporterMaciej Izak Assigned ToSven Barth  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.7.1 
Fixed in Version3.0.0 
Summary0025596: Keyword "with" don't work with default property in generic class
DescriptionKeyword "with" don't work with default property in generic class:

{$MODE DELPHI}

type
  TA<T> = class
  public
    function Foo(Idx: Integer): T; virtual; abstract;
    property P[Index: Integer]: T read Foo; default;
  end;

  { TB }

  TB<T> = class
    type
      TC = record
        H: T;
      end;
    var
      H: TA<TC>;

    procedure Boo;
  end;

{ TB<T> }

procedure TB<T>.Boo;
begin
  with H[0] do
    // compiler should use H from TC type (is probably using H from TB<T>).
    if H = 0 then ; // Error: Operator not overloaded "$TA$1" = "ShortInt"
  // if H[0].H = 0 then // <- is ok
end;
Tagsgenerics
Fixed in Revision27861
FPCOldBugId
FPCTarget
Attached Files

Relationships

related to 0027206 resolvedSven Barth [Patch] Christmas gift by FreeSparta : Generics.Collections 

Activities

Maciej Izak

2014-01-24 23:34

reporter  

r01.lpr (601 bytes)

Sven Barth

2015-01-06 14:40

manager   ~0080153

It seems that I fixed this already with my partial specializations support from June.

Please test and close if okay.

Regards,
Sven

Issue History

Date Modified Username Field Change
2014-01-24 23:34 Maciej Izak New Issue
2014-01-24 23:34 Maciej Izak File Added: r01.lpr
2014-01-24 23:35 Maciej Izak Tag Attached: generics
2015-01-06 14:34 Sven Barth Relationship added related to 0027206
2015-01-06 14:40 Sven Barth Fixed in Revision => 27861
2015-01-06 14:40 Sven Barth Note Added: 0080153
2015-01-06 14:40 Sven Barth Status new => resolved
2015-01-06 14:40 Sven Barth Fixed in Version => 2.7.1
2015-01-06 14:40 Sven Barth Resolution open => fixed
2015-01-06 14:40 Sven Barth Assigned To => Sven Barth