D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9394 - ABI for static arrays is outdated
Summary: ABI for static arrays is outdated
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-25 16:14 UTC by Andrej Mitrovic
Modified: 2013-02-07 04:55 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2013-01-25 16:14:49 UTC
Quote:

---------
int[3] abc;
---------

	$(P Passing abc to functions results in these implicit conversions:)

---------
void func(int[3] array); // actually <reference to><array[3] of><int>
void func(int* p);       // abc is converted to a pointer
                         // to the first element
void func(int[] array);	 // abc is converted to a dynamic array
---------

w.r.t. comments:

For the first func: This is only true in D1.

For the second func: I didn't even know worked in D2. But I don't see the benefit of such a conversion (perhaps interfacing with C?).

For he third func: I thought we always had to use a slice, but it seems to work without it. How come?
Comment 1 github-bugzilla 2013-02-06 20:04:52 UTC
Commits pushed to master at https://github.com/D-Programming-Language/d-programming-language.org

https://github.com/D-Programming-Language/d-programming-language.org/commit/50381d3356dfa5fea7cc186ddc1cf9c002d5180d
Fixes Issue 9394 - Fix static array ABI.

Static arrays are not implicitly converted to references in D2.

https://github.com/D-Programming-Language/d-programming-language.org/commit/49e28977b1f36d5af591a77a078fa6922a5bbd1e
Merge pull request #258 from AndrejMitrovic/Fix9394

Issue 9394 - Fix static array ABI.
Comment 3 github-bugzilla 2013-02-07 04:55:28 UTC
Commits pushed to master at https://github.com/D-Programming-Language/d-programming-language.org

https://github.com/D-Programming-Language/d-programming-language.org/commit/a6324ef708fa7922b87251eeeb98322d3da22382
fix Issue 9394 - ABI for static arrays is outdated

Almost of "Reference Types" section is outdated in D2.

https://github.com/D-Programming-Language/d-programming-language.org/commit/20152e47f2651308268eec487c697769a96c7e9a
Merge pull request #262 from 9rnsr/fix9394

Issue 9394 - ABI for static arrays is outdated