View Issue Details

IDProjectCategoryView StatusLast Update
0034015FPCDocumentationpublic2018-07-21 12:09
ReporterThaddy de KoningAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformallOSallOS Versionall
Product Version3.0.4Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0034015: reference manual contains example for extended records that has multiple bugs
DescriptionTTest4 = record
 private
   a : Integer;
 protected // not allowed in records
   function getp : integer;
 public
   b : string;
   procedure setp (aValue : integer);
   property p : integer read Getp Write SetP;
 public
 case x : integer of
   1 : (Q : string); // should be string[255] Variant records:
   2 : (S : String); // should be string[255], managed types are not allowed.
 end;
Additional InformationShould be something like:
type
TTest4 = record
 private
   a : Integer;
   function getp : integer;
 public
   b : string;
   procedure setp (const aValue : integer);
   property p : integer read Getp Write SetP;
 public
 case x : integer of
   1 : (Q : string[255]);
   2 : (S : String[255]);
 end;
 
 function TTest4.getp : integer;
 begin
   Result := a;
 end;
 procedure TTest4.setp (const aValue : integer);
 begin
   a :=aValue;
 end;
  
begin
end.


TagsNo tags attached.
Fixed in Revision1495
FPCOldBugId
FPCTarget
Attached Files

Activities

Thaddy de Koning

2018-07-21 11:20

reporter   ~0109598

Last edited: 2018-07-21 11:21

View 2 revisions

And {$modeswitch advancedrecords} or {$Mode delphi}
The example assumes shortstring but even then it is incorrect in {$H-} because no size is given.

Michael Van Canneyt

2018-07-21 12:09

administrator   ~0109599

Indeed, well spotted ! Fixed, thanks for reporting!

Issue History

Date Modified Username Field Change
2018-07-21 11:16 Thaddy de Koning New Issue
2018-07-21 11:16 Thaddy de Koning Status new => assigned
2018-07-21 11:16 Thaddy de Koning Assigned To => Michael Van Canneyt
2018-07-21 11:20 Thaddy de Koning Note Added: 0109598
2018-07-21 11:21 Thaddy de Koning Note Edited: 0109598 View Revisions
2018-07-21 12:09 Michael Van Canneyt Fixed in Revision => 1495
2018-07-21 12:09 Michael Van Canneyt Note Added: 0109599
2018-07-21 12:09 Michael Van Canneyt Status assigned => resolved
2018-07-21 12:09 Michael Van Canneyt Fixed in Version => 3.1.1
2018-07-21 12:09 Michael Van Canneyt Resolution open => fixed
2018-07-21 12:09 Michael Van Canneyt Target Version => 3.2.0