[Issue 15564] Bogus non local error messages
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Wed Jan 20 02:57:58 PST 2016
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15564
Martin Nowak <code at dawg.eu> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86                         |All
                 OS|Mac OS X                    |All
--- Comment #4 from Martin Nowak <code at dawg.eu> ---
cat > bug.d << CODE
struct Foo
{
    void foo(alias f)()
    {
        f(2);
    }
}
void test()
{
    Foo foo;
    foo.foo!(function(int a) => 2 * a)(); // works w/ function
    foo.foo!(function(a) => 2 * a)(); // doesn't work w/ function template
}
CODE
dmd -c bug
----
bug.d(13): Error: template instance foo!(function (a) => 2 * a) cannot use
local '__funcliteral1' as parameter to non-global template foo(alias f)()
----
This was already not possible in 2.066.1.
--
    
    
More information about the Digitalmars-d-bugs
mailing list