-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-type-systemArea: Type systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
A boxed iface is a pair of a regular box holding the self value and a vtable pointer. When creating such a thing from a box, one currently has to do (*my_box) as my_iface
. It would be great if we could somehow just bump the refcount of the box and slap a vtable on it.
Proposed solution: make cast-to-iface, when no impl is found, autoderef the left hand side. If it finds a match for the box' contents, it'll resolve to that impl, and the trans code will notice this and skip the boxing. So my_box as my_iface
would be a very cheap operation.
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.