[Issue 17738] New: access to local alias from outside compiles but execution hangs

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Aug 10 03:32:43 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17738

          Issue ID: 17738
           Summary: access to local alias from outside compiles but
                    execution hangs
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dominikus at scherkl.de

import std.traits;

foo.C foo(T, U)(const(T) a, const(U) b)
{
   alias C = CommonType!(T, U);
   return cast(C)a + cast(C)b;
}
// compiles, but execution hangs (programm uses 100% CPU and only ends after
stack overflow is reached some time later)

CommonType!(T, U) foo2(T, U)(const(T) a, const(U) b)
{
   alias C = CommonType!(T, U);
   return cast(C)a + cast(C)b;
}
// compiles and runs fine

--


More information about the Digitalmars-d-bugs mailing list