View Issue Details

IDProjectCategoryView StatusLast Update
0035149FPCCompilerpublic2021-04-11 12:00
ReporterJulian Puhl Assigned ToJonas Maebe  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformwin32 
Product Version3.3.1 
Fixed in Version3.2.0 
Summary0035149: Revision 40785 breaks sizeof call for nested vars
DescriptionIf you compile the given example you'll get the (wrong) error message:
"project1.lpr(11,39) Error: Only static methods and static variables can be referenced through an object type".

I've also gotten this error for using nested types in some cases, but could not create a small example that breaks, yet.
Steps To Reproduceprogram project1;

{$mode objfpc}
type
  TestObject = object
  var
    TestNested: Integer;
  end;

begin
  writeln(SizeOf(TestObject.TestNested));
end.
TagsNo tags attached.
Fixed in Revision41474,41943
FPCOldBugId
FPCTarget-
Attached Files

Activities

Anton Kavalenka

2019-02-25 19:43

reporter   ~0114425

IMO class vars have to be in class or advanced record entity.

Old TP-style objects cannot hold class-vars.

Jonas Maebe

2019-02-25 20:29

manager   ~0114428

FPC supports the "static" keyword to declare class variables in TP-style objects.

Julian Puhl

2019-02-25 20:35

reporter   ~0114429

It works with records, so why wouldn't it with objects?

Jonas Maebe

2019-02-25 21:17

manager   ~0114432

Thanks, fixed.

Issue History

Date Modified Username Field Change
2019-02-25 16:50 Julian Puhl New Issue
2019-02-25 19:43 Anton Kavalenka Note Added: 0114425
2019-02-25 20:29 Jonas Maebe Note Added: 0114428
2019-02-25 20:35 Julian Puhl Note Added: 0114429
2019-02-25 21:17 Jonas Maebe Fixed in Revision => 41474
2019-02-25 21:17 Jonas Maebe Note Added: 0114432
2019-02-25 21:17 Jonas Maebe Status new => resolved
2019-02-25 21:17 Jonas Maebe Fixed in Version => 3.3.1
2019-02-25 21:17 Jonas Maebe Resolution open => fixed
2019-02-25 21:17 Jonas Maebe Assigned To => Jonas Maebe
2021-04-11 12:00 Jonas Maebe Fixed in Version 3.3.1 => 3.2.0
2021-04-11 12:00 Jonas Maebe Fixed in Revision 41474 => 41474,41943
2021-04-11 12:00 Jonas Maebe FPCTarget => -