I just investigated the difference between the Delphi 7 and Delphi 2007
Package source.
I noticed were a compile of settings which were different.
I have now discovered one setting which causes the bug to pop-up:
{$RANGECHECKS ON} <- causes the compiler bug.
{$RANGECHECKS OFF} <- fixes the compiler bug.
Strange ?!
package Test2;
{$R *.res}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO ON}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS ON}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION ON}
{$OVERFLOWCHECKS ON}
{$RANGECHECKS OFF}
{$REFERENCEINFO ON}
{$SAFEDIVIDE OFF}
{$STACKFRAMES OFF}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$IMPLICITBUILD OFF}
requires
rtl;
contains
unit_TabstractNumberCollection_version_005 in
'TabstractNumberCollection\version 0.05 restore the
design\unit_TabstractNumberCollection_version_005.pas',
Unit_TbitNumberCollection_version_004 in 'TBitNumberCollection\version
0.04 based on version 0.02 design
restored\Unit_TbitNumberCollection_version_004.pas',
unit_TscalableBitSet_version_007 in 'TscalableBitSet\version
0.07\unit_TscalableBitSet_version_007.pas';
end.
Bye,
Skybuck.
[Fatal Error] Unit_TbitNumberCollection_version_004.pas(60): Internal error:
C1091
Cursor is positioned at this line in the source code:
mBits : Tbits; // simply use delegation
function GetSize : uint64; override;
function TbitNumberCollection.GetSize : uint64;
begin
result := mBits.Size;
end;
Bye,
Skybuck.
Thanks to a typecast the compiler bug is solved.
Also thanks to Delphi 7 I finally found the source line which is probably
causing this bug.
Delphi 7 places the cursor at the problem line !
Delphi 2007 is just stupid and stares like a dumb cow ! TUTTUTUTUTUTUTUT.
{
function TbitNumberCollection.GetSize : uint64;
begin
result := mBits.Size;
end;
}
// typecast solves compiler bug with range checking on.
// thanks to Delphi 7 for placing the cursor at the problem line which
Delphi 2007 does not do !!! >(((((
function TbitNumberCollection.GetSize : uint64;
begin
result := uint64(mBits.Size);
end;
Bye,
Skybuck.