Thread overview
[Issue 12676] alias parameter attempts to interpret symbol
Apr 29, 2014
Andrej Mitrovic
Apr 29, 2014
Andrej Mitrovic
Apr 30, 2014
Andrej Mitrovic
Apr 30, 2014
Andrej Mitrovic
Dec 17, 2022
Iain Buclaw
April 29, 2014
https://issues.dlang.org/show_bug.cgi?id=12676

--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
Sorry, the example is a bit wrong. Fixed:

-----
template TemplAlias1(
    alias x = C  // default
) { }

template TemplAlias2(
    alias x : C  // specialization
) { }

template TemplAlias3(
    alias x : C = C  // default = C, specializes to C
) { }

void main()
{
    alias a = TemplAlias1!();
    alias b = TemplAlias2!(C);
    alias c = TemplAlias3!();
}
-----

--
April 29, 2014
https://issues.dlang.org/show_bug.cgi?id=12676

--- Comment #2 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
Here:

-----
class C { }
class D : C { }

template TemplAlias(
    alias x : D = C
) { }
-----

For some reason in the parser isDeclaration() returns false for ": Type", but
true for "= Type", and either a parseType() or a parseCondExp() is taken.Later
in in the semantic phase the alias class tries to evaluate D as an expression
rather than as a type so it fails.

--
April 30, 2014
https://issues.dlang.org/show_bug.cgi?id=12676

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

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

--- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
Not a bug, aliases work on literals and expressions, not types.

--
April 30, 2014
https://issues.dlang.org/show_bug.cgi?id=12676

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #4 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
Ok, the OP example wasn't supported, but this must be a bug:

-----
template Templ1() { }

template Templ2
(
    alias T : Templ1 = Templ1,
) { }
-----

test.d(5): Error: Cannot interpret Templ1() at compile time

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=12676

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 13
https://issues.dlang.org/show_bug.cgi?id=12676

--- Comment #5 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17656

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--