www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16653] New: ParameterDefaultValueTuple fails to compile when


          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 puremagic.com
          Reporter: goldmax3000 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:
/d321/f969.d(5): instantiated from here: ParameterDefaultValueTuple!(f)
/d321/f969.d(5): while evaluating pragma(msg, ParameterDefaultValueTuple!(f))

Oct 31 2016