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
Throw error when objects are passed instead of traits (#2649)
The corner case here is when an object implements a Rust-only trait.
In the updated coverall fixture we have the following Python classes:
- StringUtilProtocol - interface for the trait
- StringUtil - object that implements the trait via rust calls
- StringUtilObject - exported Rust object that imprements the trait
Before `StringUtilObject` would inherit from `StringUtil`, which isn't
correct conceptually and in practice it means that the Python code will
try to lower the handle into a function that expects `Arc<dyn
StructUtil>` when the handle was actually for `Arc<StringUtilObject>`,
once Rust tries to use the arc a segfault will happen soon after.
Now `StringUtilObject` inherits from `StringUtilProtocol` and we don't
have the segfault.
I tried to add Kotlin and Swift tests here, but it doesn't work because
they throw a type error as soon as you try making that call.
0 commit comments