|
Archives
D Programming
digitalmars.Ddigitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger D.gnu D C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.bugs - [Issue 3766] New: Pointers to pure, nothrow functions be subtypes of regular functions
http://d.puremagic.com/issues/show_bug.cgi?id=3766 Summary: Pointers to pure, nothrow functions be subtypes of regular functions Product: D Version: 2.040 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: dsimcha yahoo.com --- Comment #0 from David Simcha <dsimcha yahoo.com> 2010-02-03 13:56:10 PST --- void nothrowStuff() nothrow {} void pureStuff() pure {} void stuff() {} auto funcPtr = (0 == 0) ? &stuff : ¬hrowStuff; auto funcPtr2 = (0 == 0) ? &stuff : &pureStuff; test.d(5): Error: incompatible types for ((& stuff) ? (& nothrowStuff)): 'void function()' and 'void function() nothrow' test.d(6): Error: incompatible types for ((& stuff) ? (& pureStuff)): 'void function()' and 'void function() pure' void function() pure and void function() nothrow should be considered subtypes of void function(). A void function() pure or a void function() nothrow simply provides an extra guarantee not present for void function() and thus can be substituted in any context for a void function(). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- Feb 03 2010
|