View Issue Details

IDProjectCategoryView StatusLast Update
0037020FPCCompilerpublic2020-05-09 03:27
ReporterRyan Joseph Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version3.3.1 
Summary0037020: Constants in generics fail with empty sets
DescriptionSpecializing a generic with an empty set fails when it should not.
Steps To Reproduce{$mode objfpc}

program test;

type
 TItem = (A, B, C);
 TItems = set of TItem;
 generic GType<const T: TItems> = class
 end;

const
 TOtherItems = []; // no problems here

type
 // error: Incompatible types: got "Empty Set" expected "TItems"
 TType = specialize GType<[]>;

begin
end.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

Florian

2020-05-08 22:01

administrator   ~0122675

@Ryan: this is something you should fix yourself, the constant generics patch is after all yours, right?

Ryan Joseph

2020-05-09 03:27

reporter   ~0122676

yes, I'll be getting to it soon. Just putting it here so I can keep track of it. (same for the other one).

Issue History

Date Modified Username Field Change
2020-05-05 04:01 Ryan Joseph New Issue
2020-05-08 22:01 Florian Note Added: 0122675
2020-05-09 03:27 Ryan Joseph Note Added: 0122676