The worst Phobos template (in binderoo)
Dicebot via Digitalmars-d
digitalmars-d at puremagic.com
Sat Oct 1 03:19:21 PDT 2016
On 09/29/2016 07:02 PM, David Nadlinger wrote:
> On Thursday, 29 September 2016 at 13:58:44 UTC, Eugene Wissner wrote:
>> Any chance to get this one working:
>>
>> import std.typecons;
>>
>> enum Stuff
>> {
>> asdf,
>> }
>>
>> void main()
>> {
>> BitFlags!Stuff a;
>> mixin(__traits(fullyQualifiedName, typeof(a)) ~ " c;");
>> }
>
> This wouldn't be a correct use of the feature anyway, since it runs into
> all sorts of fundamental issues with imports/scoping, aliases and
> templates. Using .stringof/fullyQualifiedName to generate a reference to
> a type or symbol in a string mixin is a mistake, period. Unfortunately,
> the misconception that they *are* code generation tools is fairly
> wide-spread, to the point where dlang.org contains a similarly
> misleading comment. [1]
What are the issues with fullyQualifiedName in that context? I mean
other than Voldemort types of course. I'd expect `static import` +
`fullyQualifiedName` combo to be reasonably reliable and used it a lot
in the past. Do you refer to aliases with changed protection attributes?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20161001/06e7fc7e/attachment.sig>
More information about the Digitalmars-d
mailing list