We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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
?The text was updated successfully, but these errors were encountered: