gircore/gir.core

Idea: improve type detection

Opened this issue · 0 comments

badcel commented

It can happen that the real type can't be detected properly from the type system especially in the case of anonymous classes which implement several interfaces as the first interface is chosen.

To have a way forward the list APIs should have some api to support casting their content to an explicit type defined by the user.

This could be a little tricky as then there could be two instances in the cache for one pointer e.g. one casted to an interface helper and one version casted to a concrete class (e.g. Object).

In this case the toggle references dead lock each other. The documentation states that toggle references should only be used if the proxy object carries custom data. So the idea would be to get rid of toggle references at least for given types and simply always use weak references.

For custom subclasses some solution needs to be found.