Summary: Function literals are non-constant.
           Product: D
           Version: 2.023
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

This code fails compilation:

  void test () { }

  // Compiles okay.
  auto a = &test;

  // Error: non-constant expression __funcliteral1
  auto b = function void () { }; 

As far as I can tell there is no reason for function literals to be
non-constant if they're not synthesized during runtime.


Reply via email to