D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7813 - lambda lost during header gen
Summary: lambda lost during header gen
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 17:56 UTC by Martin Nowak
Modified: 2013-10-11 07:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2012-04-02 17:56:48 UTC
cat > bug.d << CODE
void foo(alias pred)()
{
}

void bar()
{
    foo!(a => a + 1)();
}
CODE

dmd -H -o- -c bug

--------

The lambda template is not emitted and leaving
the header with an unknown symbol.

foo!(__lambda2)();
Comment 1 Kenji Hara 2013-10-11 07:15:04 UTC
With 2.064 git-head,

void foo(alias pred)()
{
}
void bar()()   // Make template to output function body in di file
{
    foo!(a => a + 1)();
}

dmd -H -o- test.d

Outputs:
// D import file generated from 'test.d'
template foo(alias pred)
{
	void foo()
	{
	}

}
template bar()
{
	void bar()
	{
		foo!((a) => a + 1)();   // correct
	}

}