[Issue 7947] New: typeof on anonymous function literal returns void

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 20 02:18:09 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7947

           Summary: typeof on anonymous function literal returns void
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: james at aatch.net


--- Comment #0 from James Miller <james at aatch.net> 2012-04-20 02:19:04 PDT ---
The following code:

  pragma(msg, typeof(x => x));

prints out void. Semi understandable, if unintuitive.

this also does

  test(alias fn, T)(T t)
  if(is(typeof(fn(t))))
  {
    pragma(msg, typeof(fn));
  }
  test!(x => x < 5)(10);

Which is more annoying. There should either be an error in this case

Also happens with expanded function(...){...} syntax, as long as the parameter
types are not specified.

-- 
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