Jump to page: 1 2
Thread overview
[Issue 9029] New: Built-in types treated specially for alias parameters
Nov 15, 2012
timon.gehr@gmx.ch
Nov 15, 2012
yebblies
Nov 26, 2012
Manu
Nov 29, 2012
Don
Nov 29, 2012
Manu
Nov 29, 2012
Jacob Carlborg
Nov 29, 2012
Don
Nov 29, 2012
Manu
Nov 29, 2012
Jacob Carlborg
Nov 29, 2012
Manu
Nov 30, 2012
Don
Nov 30, 2012
Manu
November 15, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9029

           Summary: Built-in types treated specially for alias parameters
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: timon.gehr@gmx.ch


--- Comment #0 from timon.gehr@gmx.ch 2012-11-15 02:13:29 PST ---
DMD 2.060:

template Foo(alias a){ }
struct S{}

alias S X;     // ok
alias int Y;   // ok
mixin Foo!S;   // ok
mixin Foo!int; // not ok

The code should compile.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 15, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9029


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |galaxylang@gmail.com


--- Comment #1 from yebblies <yebblies@gmail.com> 2012-11-15 22:23:02 EST ---
*** Issue 8491 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: -------
November 26, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9029


Manu <turkeyman@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |turkeyman@gmail.com


--- Comment #2 from Manu <turkeyman@gmail.com> 2012-11-26 11:51:04 PST ---
I'm suffering from this problem too.
Fix would be nice! :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9029



--- Comment #3 from Don <clugdbug@yahoo.com.au> 2012-11-29 02:15:11 PST ---
This is one of those perennial issues, that everybody discovers.

Previous enhancement requests identical to this one include bug 1100, bug 3116, bug 4639. I remember requesting it once, as well.

It goes back even further. Here's a discussion from July 2004 (template alias parameters were first implemented in Jan 2004, so this is the dawn of time):

http://digitalmars.com/d/archives/digitalmars/D/6063.html

Interestingly one thing which _was_ changed in D2 is that template alias parameters can now include expressions. Late in the history of D1, local variables were also added as template alias parameters. But still not basic types.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9029



--- Comment #4 from Manu <turkeyman@gmail.com> 2012-11-29 03:37:32 PST ---
(In reply to comment #3)
> This is one of those perennial issues, that everybody discovers.
> 
> Previous enhancement requests identical to this one include bug 1100, bug 3116, bug 4639. I remember requesting it once, as well.
> 
> It goes back even further. Here's a discussion from July 2004 (template alias parameters were first implemented in Jan 2004, so this is the dawn of time):
> 
> http://digitalmars.com/d/archives/digitalmars/D/6063.html
> 
> Interestingly one thing which _was_ changed in D2 is that template alias parameters can now include expressions. Late in the history of D1, local variables were also added as template alias parameters. But still not basic types.

There was a proposal recently on the NG suggesting builtin types should have entries in the symbol table. Sounded fairly reasonable.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9029


Jacob Carlborg <doob@me.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |doob@me.com


--- Comment #5 from Jacob Carlborg <doob@me.com> 2012-11-29 04:13:50 PST ---
(In reply to comment #4)

> There was a proposal recently on the NG suggesting builtin types should have entries in the symbol table. Sounded fairly reasonable.

Yeah, this is what the dragon book suggests as well.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9029



--- Comment #6 from Don <clugdbug@yahoo.com.au> 2012-11-29 08:08:00 PST ---
(In reply to comment #5)
> (In reply to comment #4)
> 
> > There was a proposal recently on the NG suggesting builtin types should have entries in the symbol table. Sounded fairly reasonable.
> 
> Yeah, this is what the dragon book suggests as well.

Huh? There is no technical difficulty whatsoever, AFAIK it was _never_ thought to be difficult to implement.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9029



--- Comment #7 from Manu <turkeyman@gmail.com> 2012-11-29 10:01:54 PST ---
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > 
> > > There was a proposal recently on the NG suggesting builtin types should have entries in the symbol table. Sounded fairly reasonable.
> > 
> > Yeah, this is what the dragon book suggests as well.
> 
> Huh? There is no technical difficulty whatsoever, AFAIK it was _never_ thought to be difficult to implement.

When did the difficulty come in to question? Something to do with this 'dragon book' that I don't understand?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9029



--- Comment #8 from Jacob Carlborg <doob@me.com> 2012-11-29 11:58:16 PST ---
(In reply to comment #7)

> When did the difficulty come in to question? Something to do with this 'dragon book' that I don't understand?

I don't know. There's a book called "Compilers: Principles, Techniques, and Tools" which is also referred to as "the dragon book". It's basically the bible for compiler construction. If I recall correctly, Walter has said that DMD doesn't contain any fancy code, just the standard algorithms present in the dragon book.

http://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9029



--- Comment #9 from Manu <turkeyman@gmail.com> 2012-11-29 12:22:15 PST ---
I ran into this bug again today twice. In one case the alias was to receive 'void' which it didn't like either.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
« First   ‹ Prev
1 2