-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
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
Fix issue #1283 #1855
Fix issue #1283 #1855
Conversation
@dotnet-policy-service agree |
Thanks so much for looking into this, any chance you could add a test to the test suite? |
Sure, here you go! (I hope I added it in the correct place 😅) |
We usually have these in https://github.com/mono/CppSharp/blob/main/tests/dotnet/CSharp/CSharp.Tests.cs / https://github.com/mono/CppSharp/blob/main/tests/dotnet/CSharp/CSharp.h which actually does end-to-end testing, but I guess there is nothing inherently wrong with your approach, its just gives a bit less guarantees. |
Agh, I had it there first, then saw there was a suite for the passes. Alright, I'll move it over. |
So with the test in the new position, the build just fails and the tests can't even be run when the issue is present:
Is that acceptable? |
I think so, there seems to be some delay in running the macOS CI, but looks good otherwise. |
The mac CI is still not running, but since its already passing on other platforms, I will just merge it. Again, thanks for the fix. |
No problem! |
See #1283 .
GetterSetterToPropertyPass
currently fails on the following code:Resulting output
The namespace is important. If
Bar
is declared inside the same namespace the bug is not triggered. However, my original code where I encountered this bug did have both classes in the same namespace, though they were in different header files.The bug occurs when it tries to determine whether the property overrides a base property here.
When
Bar
is outside the namespace,Bar
gets processed beforeDorld
, soDorld
doesn't have the property created yet. The check fails and the property is not created onBar
. The property is then later created onDorld
when the pass finally visitsDorld
.When instead
Bar
is inside the namespace,Dorld
is visited first and the code continues as expected.Fixed by setting the
VisitFlags.ClassBases
flag on the pass.