www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13995] New: Alias type stringof decay to alias type stringof


          Issue ID: 13995
           Summary: Alias type stringof decay to alias type stringof
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: deadalnix gmail.com

alias T = int;

Print int. This do not look like a big issue, but it makes most mixin fails,
including phobos's ones, when used in templates. Things like this are going to
fail hard with a very obscure error :

module a;

template Foo(T) { mixin(someting that use T.stringof); }

module b;

class C {}

import a;

stringof will resolve as C, which do not exist in the template Foo, and all
come to an halt.

This is causing a lot of trouble in SDC right now to pack thing in bitfield.
Packing data is crucial for performance and memory consumption.

Jan 17 2015