Thread overview
[Issue 6963] New: pure/nothrow inference doesn't work for function pointers
Nov 17, 2011
Don
Nov 18, 2011
Kenji Hara
Nov 30, 2011
Kenji Hara
Feb 05, 2013
Andrej Mitrovic
November 17, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6963

           Summary: pure/nothrow inference doesn't work for function
                    pointers
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: clugdbug@yahoo.com.au


--- Comment #0 from Don <clugdbug@yahoo.com.au> 2011-11-16 20:30:27 PST ---
void foo(X)(X x) {}

immutable void function(int) pure bar = &foo!(int);

test.d(7): Error: cannot implicitly convert expression (& foo) of type void fun
ction(int x) to immutable(void function(int) pure)


Incidentally, this code:

immutable nothrow pure bar = &foo!(int);

compiles without error, but bar isn't pure nothrow!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 18, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6963



--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-18 02:20:42 PST ---
It doesn't occur if the declarations are in function scope.

void foo(X)(X x) {}

// doesn't work
//immutable void function(int) pure bar1 = &foo!(int);
//immutable nothrow pure bar2 = &foo!(int);

void main()
{
    // does work
    immutable void function(int) pure bar1 = &foo!(int);
    immutable nothrow pure bar2 = &foo!(int);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 30, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6963


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch, rejects-valid
           Platform|Other                       |All
         OS/Version|Windows                     |All


--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-30 14:50:45 PST ---
https://github.com/D-Programming-Language/dmd/pull/544

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 08, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6963



--- Comment #3 from github-bugzilla@puremagic.com 2012-11-08 01:23:13 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0c86463e012dc6f95d996e0d627ca177a23e730a fix Issue 6963 - pure/nothrow inference doesn't work for function pointers

If the VarDeclaration is not a compile time constant, defer semantic of it's initializer.

https://github.com/D-Programming-Language/dmd/commit/f6a212814630113441a567777a307a197400b922 Merge pull request #544 from 9rnsr/fix6963

Issue 6332 & 6356 & 6963 - Ignite pure/nothrow inference for template function

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 05, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6963


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich@gmail.com
         Resolution|                            |FIXED


--- Comment #4 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-05 13:12:40 PST ---
Seems fixed now.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------