www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3673] New: inheritance + if clause = no go

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

           Summary: inheritance + if clause = no go
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrei metalanguage.com



11:34:00 PST ---
This code should compile:

interface OutputRange(T...) if (T.length == 1)
{
    void put(T[0] value);
}

interface OutputRange(T...) : OutputRange!(T[0]), OutputRange!(T[1 .. $])
                              if (T.length > 1)
{
}

The first error is "members expected" upon the "if" clause in the second
definition, which suggests that the syntax is not yet supported.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 04 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3673


Max Samukha <samukha voliacable.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |samukha voliacable.com



PST ---
This syntax is supported:

interface OutputRange(T...) if (T.length > 1)
    : OutputRange!(T[0]), OutputRange!(T[1 .. $])
{
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3673




PST ---
Also, each interface adds sizeof(void*) bytes to the class instance size. While
recursive inheritance provides a separate interface for each type, which may be
a nice property, the overhead, for example, of OutputRange!basicTypes would be
significant.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3673




06:04:40 PST ---
Thanks, Max. Yah, the overhead is kinda crippling. I'm also thinking of
TextOutputRange, which is an alias for OutputRange!(const(char)[],
const(wchar)[], const(dchar)[], char, wchar, dchar). That would be 24 bytes to
boot. Maybe I better use a recursive mixin to generate all functions inside the
interface.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3673


Kosmonaut <Kosmonaut tempinbox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsimcha yahoo.com



---
*** Issue 4698 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 20 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3673


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |yebblies gmail.com
           Platform|Other                       |All
            Version|2.038                       |D2
         OS/Version|Linux                       |All
           Severity|normal                      |enhancement



Andrej's Pull:

https://github.com/D-Programming-Language/dmd/pull/1227

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 27 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3673




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/b8ed73f4ffc49272f95c6ce9ceb56330e3a101b9
Fixes Issue 3673 - Allow putting constraint after inheritance list.

https://github.com/D-Programming-Language/dmd/commit/43251183f885d5a309171b7139d94d22a60cace3


[enh] Issue 3673 - Allow putting constraint after inheritance list

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 10 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3673


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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