One important note here. This patch will change cast behaviour in case of local and foreign types are mismatched.
The problem is if we cannot convert types locally, this does not mean that it is also true for a foreign wrapped data.
In any case, it's up to the committer to decide whether this change is needed or not.
-- Best regards,
Maxim Orlov.