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
Default Parameters
Dynamic Arrays
Overloading
Variants
Linker
Make Logic
Memory Manager
OBJ Generation
OBJ Support
Other Compiler
Packages
RTTI
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/Language
[ Add a report in this area ]
Report #:
10620
Status:
Closed
Open arrays of Char/WideChar does not accept Dynamic arrays of same type
Project:
Delphi
Build #:
7.0.4.453
Version:
7.0
Submitted By:
Carlos Beppler
Report Type:
Basic functionality failure
Date Reported:
1/26/2005 9:08:11 AM
Severity:
Serious / Highly visible problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All versions
Internal Tracking #:
219359
Resolution:
Retest
(Resolution Comments)
Resolved in Build:
:
7.0.4.453
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
4.00 out of 5
Total Votes:
None
Description
I can pass an dynamic array to a routine expecting open arrays, but it fails when the base type of the arrays is Char/WideChar.
This code compiles:
procedure Clear(var A: array of Integer);
var
I: Integer;
begin
for I := 0 to High(A) do A[I] := 0;
end;
procedure Test;
var x: array of Integer;
y: Integer;
begin
SetLength(x,10);
Clear(x);
Clear(y);
end;
But this does not (generates incompatible types Array and dynamic array):
procedure Clear(var A: array of Char);
var
I: Integer;
begin
for I := 0 to High(A) do A[I] := #0;
end;
procedure Test;
var x: array of Char;
y: Char;
begin
SetLength(x,10);
Clear(x);
Clear(y);
end;
Steps to Reproduce:
Compile the attached program below with dcc32.
See the following compile time error.
Error: E2010 Incompatible types: 'Array' and 'dynamic array
program Test;
procedure P(const A: array of Char);
begin
end;
procedure Demo;
var
A: array of Char;
begin
P(A);
end;
begin
end.
Workarounds
None
Attachment
None
Comments
Carlos Beppler at 1/26/2005 9:19:48 AM
-
Theis is a small erros on description, on second example the test procedure should be:
procedure Test;
var x: array of Char;
y: Char;
begin
SetLength(x,10);
Clear(x);
Clear(y);
end;
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