[Issue 17080] New: Can assign delegate to function
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Mon Jan  9 06:51:35 PST 2017
    
    
  
https://issues.dlang.org/show_bug.cgi?id=17080
          Issue ID: 17080
           Summary: Can assign delegate to function
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dlang at supradigital.org
The following code compiles but according to my understanding, it shouldn't.
// 
module main;
struct Foo
{
    void myFunction ( int a ) {}
}
void main()
{
    void function ( int x ) func;
    func = &Foo.myFunction;
}
--
    
    
More information about the Digitalmars-d-bugs
mailing list