Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
Compiler
Delphi
Anonymous Methods
BASM
Code Generation/Optimization
Error Recovery
Errors - Warnings
Exceptions
Execution
Finalization
Generics
Header Generation
Interaction with UI
Interfaces
Language
Linker
Make Logic
Memory Manager
OBJ Generation
OBJ Support
Other Compiler
Packages
RTTI
Custom attributes
String Resources
TD Debug Info
Thread Local Storage
Version resilience
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/Compiler/Delphi/RTTI
[ Add a report in this area ]
Report #:
96343
Status:
Open
Missing TValue class operators
Project:
Delphi
Build #:
16.0.4203.41037
Version:
16.0
Submitted By:
Stefan Glienke
Report Type:
Basic functionality failure
Date Reported:
7/18/2011 5:24:08 AM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All platforms
Internal Tracking #:
284997
Resolution:
None
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
16
Description
There are some class operator overloads missing for TValue which results in non expected behaviour. In the example project there are several unexpected types displayed.
It gets worse, when you compile it for 64bit because then the results for NativeInt and NativeUInt change.
Steps to Reproduce:
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.Rtti,
System.SysUtils;
var
v: TValue;
begin
try
v := NativeInt(High(NativeInt));
Writeln(v.TypeInfo.Name);
Writeln(v.ToString);
v := NativeUInt(High(NativeUInt));
Writeln(v.TypeInfo.Name); // expected: Cardinal, actual: Int64
Writeln(v.ToString);
v := Integer(High(Integer));
Writeln(v.TypeInfo.Name);
Writeln(v.ToString);
v := Cardinal(High(Cardinal));
Writeln(v.TypeInfo.Name); // expected: Cardinal, actual: Int64
Writeln(v.ToString);
v := Int64(High(Int64));
Writeln(v.TypeInfo.Name);
Writeln(v.ToString);
v := UInt64(High(UInt64));
Writeln(v.TypeInfo.Name); // expected: UInt64, actual: Extended
Writeln(v.ToString);
v := TValue.From<NativeUInt>(High(NativeUInt));
Writeln(v.TypeInfo.Name);
Writeln(v.ToString); // expected: 4294967295, actual: -1
v := TValue.From<Cardinal>(High(Cardinal));
Writeln(v.TypeInfo.Name);
Writeln(v.ToString); // expected: 4294967295, actual: -1
v := TValue.From<UInt64>(High(UInt64));
Writeln(v.TypeInfo.Name);
Writeln(v.ToString);
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.
Workarounds
None
Attachment
None
Comments
None
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us