java.interop icon indicating copy to clipboard operation
java.interop copied to clipboard

Do not [Register] interface alternative classes

Open jpobst opened this issue 4 years ago • 0 comments

Context: https://github.com/xamarin/java.interop/pull/798#issuecomment-777920821

For interfaces that contain static consts or other members that traditionally could not be placed on a C# interface we create an abstract class with an internal constructor that contains the members so users could access them. However, we place a [Register] on them that points to the original interface. This can cause problems when trying to resolve Java -> C# types, as multiple C# types contain the Java reference:

[Register ("android.provider.BaseColumns")] 
public abstract class BaseColumns { ... }

[Register ("android.provider.BaseColumns")] 
public interface IBaseColumns { ... }

We don't think there's any reason to put the [Register] on the abstract class, so hopefully it could be removed.

jpobst avatar Feb 16 '21 15:02 jpobst