Summary: Invalid implicit cast from "int function() ref" to
                    "int function"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2011-04-10 01:10:06 PDT ---
The following invalid D code is accepted by DMD:

import std.stdio;

int a=0;
ref int g(){
    writeln("called g");
    return ++a;

void main(){
    int function() f=&g; //this should issue an error!

called g

(&g is implicitly cast to "int function() ref", after that, the identical
calling conventions for "ref int" (int*) and int result in an implicit
reinterpret-cast from "ref int" to int.)

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to