[Issue 7135] [tdpl] Multiple delegate-related issues (literal syntax, @system deduction)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Dec 30 23:28:56 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7135
--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2011-12-30 23:28:51 PST ---
This is not the delegate literal type deduction problem.
It is a trivial mismatching of delegate types.
This is the reduced code to explain the problem.
----
struct Variant {}
class Dynamic {}
alias Variant delegate(Dynamic self, Variant[] args...) DynMethod;
void main()
{
DynMethod dg = delegate Variant(Dynamic, Variant[]) {
return Variant();
};
}
Output:
----
test.d(6): Error: cannot implicitly convert expression (__dgliteral1) of type
Variant delegate(Dynamic _param_0, Variant[] _param_1) pure nthrow @safe to
Variant delegate(Dynamic self, Variant[] args...)
DynMethod has typesafe variadic parameter, but literal doesn't have.
So this is a bug of TDPL sample code, not compiler's.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list