[Issue 4542] New: TDPL NVI example results in linker error
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sat Jul 31 16:00:56 PDT 2010
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=4542
           Summary: TDPL NVI example results in linker error
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: epi at atari8.info
--- Comment #0 from Adrian Matoga <epi at atari8.info> 2010-07-31 16:00:54 PDT ---
Trying an example from TDPL (p. 214) results in linker error.
Source:
import std.stdio;
interface Transmogrifier
{
    final void thereAndBack()
    {
        transmogrify();
        untransmogrify();
    }
private:
    void transmogrify();
    void untransmogrify();
}
class CardBoardBox : Transmogrifier
{
    override private void transmogrify()
    {
        writeln("transmogrify");
    }
    override private void untransmogrify()
    {
        writeln("untransmogrify");
    }
}
void main()
{
    (new CardBoardBox).thereAndBack();
}
Linker output:
OPTLINK (R) for Win32  Release 8.00.2
Copyright (C) Digital Mars 1989-2009  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
impl.obj(impl)
 Error 42: Symbol Undefined _D4impl14Transmogrifier12transmogrifyMFZv
impl.obj(impl)
 Error 42: Symbol Undefined _D4impl14Transmogrifier14untransmogrifyMFZv
--- errorlevel 2
The same issue occurs, when private is replaced with package.
protected and public do work.
-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
    
    
More information about the Digitalmars-d-bugs
mailing list