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 .
GetterSetterToPropertyPasscurrently fails on the following code:Resulting output
The namespace is important. If
Baris 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
Baris outside the namespace,Bargets processed beforeDorld, soDorlddoesn't have the property created yet. The check fails and the property is not created onBar. The property is then later created onDorldwhen the pass finally visitsDorld.When instead
Baris inside the namespace,Dorldis visited first and the code continues as expected.Fixed by setting the
VisitFlags.ClassBasesflag on the pass.