dstep
dstep copied to clipboard
Built-in properties are not handled correctly
Symbols with the same name as the built-in properties [1] are not handled correctly, i.e. they should have a trailing underscore like real keywords. Examples are alignof
and mangleof
. Some properties applies to all types while some other properties are specific to a subset of types.
[1] https://dlang.org/spec/property.html
Could you provide an example/example translation?
The following C code:
struct Foo
{
int mangleof;
};
Is translated to this D code:
extern (C):
struct Foo
{
int mangleof;
}
Compiling the above D code will result in the following error:
Error: variable `main.Foo.mangleof` `.mangleof` property cannot be redefined
Assuming that the above link is correct, it would be something like this:
- For classes, structs and enums:
init
,sizeof
,alignof
,mangleof
,stringof
- For enums:
min
,max
- For classes:
classinfo