Collisions between field and nested type names cause compile errors #1185
Labels
enhancement
Proposed change to current functionality
generator
Issues binding a Java library (generator, class-parse, etc.)
Context: https://developercommunity.visualstudio.com/t/I-am-using-the-Maui-class-library-to-imp/10579664
When the binding of a method collides with a nested type, we prefix the method name with
Invoke
:https://github.com/xamarin/java.interop/blob/7f08b77f3464f2b276ec5edd2e4836b1915f86dd/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBase.cs#L353
We don't appear to have any equivalent behavior when a field name collides with a nested type or property. This can result in CS0102 errors.
For example, consider the wechat-sdk-android-6.8.26.aar library. When we try to bind this, it fails:
Relevant context:
If we had automagic renaming of fields names so that they wouldn't collide with nested types, as we do with methods, this library would have been bindable without Metadata.
Metadata which allows the library to build:
The text was updated successfully, but these errors were encountered: