www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10231] New: Spec: Document alias value feature

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10231

           Summary: Spec: Document alias value feature
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: minor
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



13:54:22 PDT ---
Recently Kenji mentioned that the following works:

-----
struct X(alias int x)
{
}

void main()
{
    int i;
    alias X!i IVal;  // ok

    float f;
    alias X!f FVal;  // fail
}
-----

Even if this is allowed by the current syntax rules, it is largely an
undocumented feature (compiler implementers could easily miss this feature as
well). It should be properly documented.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 01 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10231


Maxim Fomin <maxim maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim maxim-fomin.ru



---
By the way, it seems it does not support implicit type conversions.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 01 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10231




14:37:18 PDT ---

 By the way, it seems it does not support implicit type conversions.
For that I think I'd like this enhancement to work: ----- struct X(alias T x, T : int) { } void main() { short i; alias X!i IVal; } ----- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 01 2013