[Issue 16486] Compiler see template alias like a separate type in template function definition
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Sep 12 11:54:14 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16486
Steven Schveighoffer <schveiguy at yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |schveiguy at yahoo.com
Severity|major |enhancement
--- Comment #3 from Steven Schveighoffer <schveiguy at yahoo.com> ---
The issue is that the compiler doesn't replace the alias until AFTER
instantiation.
It should be able to see that:
testFunctionC(T)(TestAliasB!T arg)
is the same as
testFunctionC(T)(TestType!(T, 3) arg)
and reduce basically to the same thing as testFunctionA
Still definitely an enhancement, as there is no definition of how the compiler
will work backwards through template instantiations.
It may be a duplicate, I distinctly remember wishing for this kind of thing
back when D2 was in infancy.
--
More information about the Digitalmars-d-bugs
mailing list