StateClass
cannot be used for classes that are not created by phper
.
#195
Labels
bug
Something isn't working
Uh oh!
There was an error while loading. Please reload this page.
master...jmjoy:phper-fork:extends
Originally posted by @jmjoy in #190 (comment)
Previously, I mentioned that it was possible to add a
StateClass::from_name
method, but I realized that I made a critical mistake. The issue is thatStateClass
creates aStateObject
usingnew_object
, and the state held byStateObject
is of type*mut dyn Any
, which is the fixed state held byphper
. However, if a non-phper
class also creates aStateObject
usingnew_object
, problems will arise—for example, the code below will result in a segmentation fault:I need to rethink the design of the
ClassEntity::extends
method to avoid this issue.The text was updated successfully, but these errors were encountered: