Open denizzzka opened 5 months ago
C header:
enum var { SOME1, SOME2 }; // payload with same as struct field name union { struct { int var:1; }; } un;
Translation into D code - var renamed to var_ inside of accessors bodies:
var
var_
[...] extern(C) { union _Anonymous_0 { static struct _Anonymous_1 { import std.bitmanip: bitfields; align(4): mixin(bitfields!( int, "var", 1, uint, "_padding_0", 7 )); } _Anonymous_1 _anonymous_2; ref auto var_() @property @nogc pure nothrow { return _anonymous_2.var_; } void var_(_T_)(auto ref _T_ val) @property @nogc pure nothrow { _anonymous_2.var_ = val; } } extern export __gshared _Anonymous_0 un; enum var { SOME1 = 0, SOME2 = 1, } enum SOME1 = var.SOME1; enum SOME2 = var.SOME2; } [...]
D compiler complains:
test2.d(72): Error: no property var_ for type _Anonymous_1, did you mean test2._Anonymous_0._Anonymous_1.var?
_Anonymous_1
test2._Anonymous_0._Anonymous_1.var
C header:
Translation into D code -
var
renamed tovar_
inside of accessors bodies:D compiler complains:
test2.d(72): Error: no property
var_
for type_Anonymous_1
, did you meantest2._Anonymous_0._Anonymous_1.var
?