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

          Issue ID: 16360
           Summary: DMD fails to inline functions that contain a type
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

When a simple type is nested in the function, e.g as an helper DMD fails to
inline:

°°°°°°°°°°°°°°°°°°°°°°°°°°°°
#!runnable-flags: -O -inline
module runnable;

import std.stdio;

pragma(inline, true)
auto foo(int t)
{
    struct Bar{}
    return t;
}

void main()
{
    auto v = foo(1);
}
°°°°°°°°°°°°°°°°°°°°°°°°°°°°

outputs:
> /tmp/temp_7FD0A006D9F0.d(7,6): Error: function runnable.foo cannot inline 
> function

--

Reply via email to