View Issue Details

IDProjectCategoryView StatusLast Update
0025602FPCCompilerpublic2015-02-01 18:09
ReporterMaciej Izak Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.7.1 
Fixed in Version3.1.1 
Summary0025602: Unclear compiler error for generic array initialization.
DescriptionInitializing arrays of this type should be locked, with clear message. Now the compiler contradicts itself.

---program---
{$MODE DELPHI}

type
  TA = class
    const C = 1;
  end;

  TB<T> = object
    procedure Foo;
  end;

procedure TB<T>.Foo;
var
  // X: array[0..T.C] of byte = (0); // Error: Expected another 1 array elements
  X: array[0..T.C] of byte = (0, 2); // Fatal: Syntax error, ")" expected but "," found
begin
end;

var
  x: TB<TA>;
begin
end.
Tagsgenerics
Fixed in Revision29598
FPCOldBugId
FPCTarget
Attached Files

Relationships

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

Activities

Maciej Izak

2014-01-25 13:14

reporter  

r06.lpr (377 bytes)

Issue History

Date Modified Username Field Change
2014-01-25 13:14 Maciej Izak New Issue
2014-01-25 13:14 Maciej Izak File Added: r06.lpr
2014-01-25 13:15 Maciej Izak Tag Attached: generics
2014-01-25 14:12 Jonas Maebe Summary Unclear compiler error for array initialization. => Unclear compiler error for generic array initialization.
2015-01-06 14:36 Sven Barth Relationship added related to 0027206
2015-02-01 18:09 Florian Fixed in Revision => 29598
2015-02-01 18:09 Florian Status new => resolved
2015-02-01 18:09 Florian Fixed in Version => 3.1.1
2015-02-01 18:09 Florian Resolution open => fixed
2015-02-01 18:09 Florian Assigned To => Florian