[Issue 16653] New: ParameterDefaultValueTuple fails to compile when function has lazy param

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Oct 31 23:54:25 PDT 2016


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

          Issue ID: 16653
           Summary: ParameterDefaultValueTuple fails to compile when
                    function has lazy param
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: goldmax3000 at gmail.com

This code:

import std.traits;

void f(lazy int x = 0) {}
pragma(msg, ParameterDefaultValueTuple!f);

gives compile error

/opt/compilers/dmd2/include/std/traits.d-mixin-1216(1216): Error: lazy
variables cannot be lvalues
/opt/compilers/dmd2/include/std/traits.d(1253): Error: template instance
std.traits.ParameterDefaultValueTuple!(f).Get!0LU error instantiating
/opt/compilers/dmd2/include/std/traits.d(1256): instantiated from here:
Impl!0LU
/d321/f969.d(5): instantiated from here: ParameterDefaultValueTuple!(f)
/d321/f969.d(5): while evaluating pragma(msg, ParameterDefaultValueTuple!(f))

--


More information about the Digitalmars-d-bugs mailing list