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
Invalid code is generated for properties with const reference types in C# generator.
And maybe C++/CLI as well, did not check.
diff --git a/tests/Common/Common.cpp b/tests/Common/Common.cpp index 2cbdddc3..84089107 100644 --- a/tests/Common/Common.cpp +++ b/tests/Common/Common.cpp @@ -538,13 +538,13 @@ SomeNamespace::AbstractClass::~AbstractClass() { } -TestProperties::TestProperties() : Field(0), _refToPrimitiveInSetter(0), +TestProperties::TestProperties() : Field(0), ConstRefField(Field), _refToPrimitiveInSetter(0), _getterAndSetterWithTheSameName(0), _setterReturnsBoolean(0), _virtualSetterReturnsBoolean(0) { } TestProperties::TestProperties(const TestProperties& other) : Field(other.Field), - FieldValue(other.FieldValue), + ConstRefField(other.ConstRefField), FieldValue(other.FieldValue), _refToPrimitiveInSetter(other._refToPrimitiveInSetter), _getterAndSetterWithTheSameName(other._getterAndSetterWithTheSameName), _setterReturnsBoolean(other._setterReturnsBoolean), diff --git a/tests/Common/Common.h b/tests/Common/Common.h index 01d6b994..5e919660 100644 --- a/tests/Common/Common.h +++ b/tests/Common/Common.h @@ -592,6 +592,7 @@ public: TestProperties(); TestProperties(const TestProperties& other); int Field; + const int& ConstRefField; int getFieldValue(); void setFieldValue(int Value); @@ -1594,4 +1595,4 @@ class TemplateClass : TemplateClassBase<A,B> { using typename TemplateClassBase<A,B>::XType; using Func = std::function<B(XType)>; explicit TemplateClass(Func function) {} -}; \ No newline at end of file +};
public int ConstRefField { get { return *((global::CommonTest.TestProperties.__Internal*) __Instance)->ConstRefField; } set { ((global::CommonTest.TestProperties.__Internal*)__Instance)->ConstRefField = &value; } }
The text was updated successfully, but these errors were encountered:
418c720
Fix generation for fields of type const reference
2acbf32
Fixes #1323. Signed-off-by: Dimitar Dobrev <[email protected]>
ddobrev
No branches or pull requests
Brief Description
Invalid code is generated for properties with const reference types in C# generator.
And maybe C++/CLI as well, did not check.
Used headers
Stack trace or incompilable generated code
The text was updated successfully, but these errors were encountered: