www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12055] New: Error: basic type expected, not extern when using 'alias = function'

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12055

           Summary: Error: basic type expected, not extern when using
                    'alias = function'
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: ibuclaw ubuntu.com



In D, you can now replace the following:

alias int _UnWind_Sword;
=>
alias _UnWind_Sword = int;


However, this doesn't seem to work with alias function.

// OK
alias extern(C) void function(_Unwind_Reason_Code, _Unwind_Exception *)
     _Unwind_Exception_Cleanup_Fn;

// Error
alias _Unwind_Exception_Cleanup_Fn
  = extern(C) void function(_Unwind_Reason_Code, _Unwind_Exception *);


I would expect this to work in the same way as the first example does.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 01 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12055


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



05:39:44 PST ---
Known bug, not sure if it was filed before. The workaround is to mark the alias
as extern(C):

extern(C) alias _Unwind_Exception_Cleanup_Fn
  = void function(_Unwind_Reason_Code, _Unwind_Exception *);

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 01 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12055




05:40:20 PST ---

 Known bug, not sure if it was filed before. The workaround is to mark the alias
 as extern(C):
 
 extern(C) alias _Unwind_Exception_Cleanup_Fn
   = void function(_Unwind_Reason_Code, _Unwind_Exception *);
Heh, I missed your OK sample there where you say the same thing. Sorry for the noise.. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 01 2014