View Issue Details

IDProjectCategoryView StatusLast Update
0037749FPCCompilerpublic2020-09-15 22:15
ReporterIgor Assigned ToSven Barth  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionwon't fix 
Product Version3.2.0 
Summary0037749: Internal class enumeration visibility error
DescriptionCompiling the attached module produces errors:

testunit.pas(24,9) Error: Duplicate identifier "teFirst"
testunit.pas(24,16) Hint: Identifier already defined in testunit.pas at line 12
testunit.pas(25,9) Error: Duplicate identifier "teSecond"
testunit.pas(26,7) Hint: Identifier already defined in testunit.pas at line 13
Steps To ReproduceCompile the attached module
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files

Relationships

has duplicate 0037748 resolvedSven Barth Internal class types visibility error 

Activities

Igor

2020-09-15 12:34

reporter  

testunit.pas (412 bytes)   
unit TestUnit;

{$mode objfpc}{$H+}

interface

type
  TTestClass1 = class
  strict private
    type
      TTestEnum = (
        teFirst,
        teSecond
      );

    const
      TestConst = 1;
  end;

  TTestClass2 = class
  strict private
    type
      TTestEnum = (
        teFirst,
        teSecond
      );

    const
      TestConst = 2;
  end;

implementation

end.

testunit.pas (412 bytes)   

Sven Barth

2020-09-15 22:14

manager   ~0125555

This is Delphi compatible and by-design. Unless $ScopedEnums On is given, enum values are global.

Issue History

Date Modified Username Field Change
2020-09-15 12:34 Igor New Issue
2020-09-15 12:34 Igor File Added: testunit.pas
2020-09-15 22:14 Sven Barth Assigned To => Sven Barth
2020-09-15 22:14 Sven Barth Status new => resolved
2020-09-15 22:14 Sven Barth Resolution open => won't fix
2020-09-15 22:14 Sven Barth FPCTarget => -
2020-09-15 22:14 Sven Barth Note Added: 0125555
2020-09-15 22:15 Sven Barth Relationship added has duplicate 0037748