D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6526 - Disambiguate mangling of AA literals
Summary: Disambiguate mangling of AA literals
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P3 normal
Assignee: No Owner
URL:
Keywords: bootcamp
Depends on:
Blocks:
 
Reported: 2011-08-18 09:23 UTC by Sean Kelly
Modified: 2024-12-13 17:56 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 Sean Kelly 2011-08-18 09:23:05 UTC
The function:

   fn!([1:2, 3:4])();

is mangled as:

   _D8demangle21__T2fnVHiiA2i1i2i3i4Z2fnFZv

The pertinent part being the way associative arrays are mangled:

   HiiA2i1i2i3i4

The type is "Hii", so an AA of int->int.  But then the value is "A2i1i2i3i4", which taken by itself suggests an array literal, not an AA literal.  This is the only instance that I've encountered where the determined type has to be communicated to the value parser so it can demangle things correctly (since it would be otherwise treated as a plain old array literal and represented as "[1,2]").  It would be better if the representation for this AA were:

   HiiH2i1i2i3i4
Comment 1 dlangBugzillaToGithub 2024-12-13 17:56:12 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18364

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB