You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[release/10.0.1xx] [src] Fix calling ConformsToProtocol on native instances that don't have a managed peer yet. Fixes#24111. (#24190)
Say we have:
1. A native type with an init method.
2. A managed binding for that native type, but the init method isn't bound.
3. A managed subclass of the managed binding (also without an implementation for the init method).
In this case, native code can create a native instance of the subclass, but no
managed code is executed, which means there won't be a corresponding managed
peer either.
This became a problem in our ConformsToProtocol override/implementation,
because recently it changed to just return 'false' if we couldn't find a
managed peer for a native instance.
The fix is to create the managed instance in that case (by doing what we
did before: call "Runtime.GetNSObject" on the native handle).
Fixes#24111.
---------
Backport of #24189.
0 commit comments