typeof.stringof wrong type

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Aug 19 08:47:00 PDT 2016


On 08/19/2016 05:36 PM, David Nadlinger wrote:
> This is a misconception. Neither .stringof nor fullyQualifiedName should
> *ever* be used in code generation.

The spec itself recommends fullyQualifiedName for code generation:

> Note: Using .stringof for code generation is not recommended, as the internal representation of a type or expression can change between different compiler versions.
>
> Instead you should prefer to use the identifier trait, or one of the Phobos helper functions such as fullyQualifiedName.

https://dlang.org/spec/property.html#stringof

Someone should edit that, if fullyQualifiedName is no good either.


More information about the Digitalmars-d-learn mailing list