digitalmars.D.bugs - [Issue 8994] New: typeof fails when passing delegate as alias parameter
- d-bugmail puremagic.com (32/32) Nov 10 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8994
- d-bugmail puremagic.com (11/11) Nov 10 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8994
- d-bugmail puremagic.com (7/9) Nov 11 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8994
- d-bugmail puremagic.com (9/14) Nov 11 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8994
http://d.puremagic.com/issues/show_bug.cgi?id=8994 Summary: typeof fails when passing delegate as alias parameter Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: deadalnix gmail.com See code below : class A { void foo() { new B!(a => visit(a), A)(); } A visit(A a) { return a; } } class B(alias fun, T) { T t; typeof(fun(t)) result; } dmd output typeoffail.d(3): Error: need 'this' to access member visit However, if typeof(fun(t)) result; is replaced by T result; or A result; everything work as expected. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 10 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8994 Maxim Fomin <maxim maxim-fomin.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |maxim maxim-fomin.ru --- This is issue 8899. Change lambda template a => visit(a) to lambda function (A a) => visit(a) and the code compiles. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 10 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8994This is issue 8899. Change lambda template a => visit(a) to lambda function (A a) => visit(a) and the code compiles.I'm not sure at the problem trigger itself precisely when using typeof. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 11 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8994 ---I think that using lambda without parameter type is often a problem. In lucky cases there is compilation error and in worse cases this leads to mysterious bugs. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------This is issue 8899. Change lambda template a => visit(a) to lambda function (A a) => visit(a) and the code compiles.I'm not sure at the problem trigger itself precisely when using typeof.
Nov 11 2012