www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 895] New: multiply defined function via alias isn't failing to build

reply d-bugmail puremagic.com writes:

           Summary: multiply defined function via alias isn't failing to
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: braddr puremagic.com

// $HeadURL: http://dstress.kuehne.cn/nocompile/alias_05.d $
// $Date: 2005-12-03 23:19:07 +0100 (Sat, 03 Dec 2005) $
// $Author: thomask $


module dstress.nocompile.alias_05;

alias int myint;

void foo(int x) {

void foo(myint m) { // error, multiply defined function foo

The compiler phase doesn't fail, though the linker does (at least on linux,
haven't tested windows).  Since alias' are supposed to be weak and
type-invisible, this should be an error, no?

Jan 27 2007
parent d-bugmail puremagic.com writes:

bugzilla digitalmars.com changed:

           What    |Removed                     |Added
           Severity|normal                      |enhancement

------- Comment #1 from bugzilla digitalmars.com  2007-01-28 16:44 -------
It gives a link error on Windows, too. While it would be nice if the compiler
issued the error, an error is still generated at build time. Moved to

Jan 28 2007