View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0022359FPCCompilerpublic2012-07-02 16:492012-09-20 11:06
ReporterJC Chu 
Assigned ToSven Barth 
Platformx86_64OSWindows NTOS Version6.1.7601
Product Version2.7.1Product Build 
Target VersionFixed in Version2.7.1 
Summary0022359: Patch to relax operator overloading restrictions
DescriptionThis is a patch on htypechk.pas to allow for previously forbidden cases of operator overloading involving simple types.

◦ internal_check() now handles enumeration, set, and floating-point types.
◦ Unnecessary restrictions on enumerations have been removed.
◦ Restrictions on the string-as-the-first-operand case have been relaxed.

There may be other valid cases not covered by this fix.
Tagsoperator overloading, patch
Fixed in Revision21975
Attached Filespatch file icon htypechk.pas.patch [^] (2,662 bytes) 2012-07-02 16:49 [Show Content]
patch file icon OpOvldFixes.patch [^] (13,885 bytes) 2012-07-04 15:20 [Show Content]
patch file icon OpOvldFixes2.patch [^] (14,766 bytes) 2012-07-06 10:58 [Show Content]
patch file icon OpOvldFixes3.patch [^] (14,766 bytes) 2012-07-06 11:04 [Show Content]

- Relationships
related to 0022860closedJonas Maebe Enums: defining enum values via mathematical expressions involving integers is no longer supported 
related to 0021505resolvedJonas Maebe Trying to overload and use >< operator results in Internal error 2008022101 

-  Notes
JC Chu (reporter)
2012-07-04 15:22
edited on: 2012-07-06 11:04

Please use the last patch file. Details about this patch can be found at [^]

*** Updated 7/6/2012
The latest patch fixes the issue of the previous version with the 64-bit compiler. The Currency type is mapped to an integer type by the 64-bit compiler and was not correctly handled by the internal_check(). The latest patch was tested for both x86_64-win64 and i386-win32 and gave identical results with the trunk.

Sven Barth (manager)
2012-07-26 20:02

I have applied your patch, but I adjusted it to conform to the coding style that is used in the compiler. Please do that yourself next time (simply check surrounding code).

Please test and close if okay.

Sven Barth (manager)
2012-07-29 18:10

There were still some problems with your changes, which I corrected in revision 21983. I also reenabled the concept of "commutative operators" (at least for those operators that can be commutative), because the compiler uses them in a commutative way.


- Issue History
Date Modified Username Field Change
2012-07-02 16:49 JC Chu New Issue
2012-07-02 16:49 JC Chu File Added: htypechk.pas.patch
2012-07-02 16:56 JC Chu Tag Attached: operator overloading
2012-07-04 15:20 JC Chu File Added: OpOvldFixes.patch
2012-07-04 15:22 JC Chu Note Added: 0060849
2012-07-04 15:22 JC Chu Note Edited: 0060849
2012-07-06 10:58 JC Chu File Added: OpOvldFixes2.patch
2012-07-06 11:04 JC Chu File Added: OpOvldFixes3.patch
2012-07-06 11:04 JC Chu Note Edited: 0060849
2012-07-06 11:13 JC Chu Tag Attached: patch
2012-07-20 13:29 Sven Barth Status new => assigned
2012-07-20 13:29 Sven Barth Assigned To => Sven Barth
2012-07-26 20:02 Sven Barth Fixed in Revision => 21975
2012-07-26 20:02 Sven Barth Status assigned => resolved
2012-07-26 20:02 Sven Barth Fixed in Version => 2.7.1
2012-07-26 20:02 Sven Barth Resolution open => fixed
2012-07-26 20:02 Sven Barth Note Added: 0061252
2012-07-29 18:10 Sven Barth Note Added: 0061282
2012-09-12 17:43 Jonas Maebe Relationship added related to 0022860
2012-09-20 11:06 JC Chu Status resolved => closed
2012-11-28 22:02 Jonas Maebe Relationship added related to 0021505

MantisBT 1.2.12[^]
Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker