Skip to content

Commit

Permalink
Merge pull request #12 from t-bltg/circ-ref
Browse files Browse the repository at this point in the history
circular reference hangs `getproperty_fallback`
  • Loading branch information
thautwarm authored Jan 4, 2024
2 parents d2ac014 + 2d3ed02 commit 80c1049
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/runtime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ function direct_fields end
"""用户可自定义的默认成员访问方法。
如果为类型A定义重载此方法,则当类型A无法根据名字`name`找到成员时,该方法被调用。
"""
function getproperty_fallback(self, name)
error("unknown property '$name' for object '$self'")
function getproperty_fallback(_::T, name) where T
error("unknown property '$name' for object of type '$T'")
end

"""用户可自定义的默认成员赋值方法。
如果为类型A定义重载此方法,则当类型A无法根据名字`name`找到可以赋值的成员时,该方法被调用。
"""
function setproperty_fallback!(self, name, value)
error("unknown property '$name' for object '$self'")
function setproperty_fallback!(_::T, name, value) where T
error("unknown property '$name' for object of type '$T'")
end

"""获取实例的基类实例。
Expand Down

0 comments on commit 80c1049

Please sign in to comment.