Check source function annotations and unify managed function identity

This commit is contained in:
2026-10-21 22:38:22 +08:00
parent eb60212428
commit 6346041f77
27 changed files with 568 additions and 40 deletions
+8
View File
@@ -51,6 +51,11 @@ impl CompareOp {
/// Rust Drop releases host resources when the payload is destroyed.
/// Equal payloads must provide compatible hashes, or reject hashing explicitly.
pub trait ObjectPayload: Any + fmt::Debug + Send + Sync {
/// Explicit function category; callable Type objects are not functions.
fn is_function(&self) -> bool {
false
}
/// Ordinary field storage may be indirect, independently of type identity.
/// Targets must be traced; retargeting records Contents on the forwarder.
fn attribute_target(&self, _store: &crate::ObjectStore) -> Result<Option<ObjectRef>, VmError> {
@@ -190,6 +195,9 @@ impl EndorNativeFunctionObject {
pub type NativeFunction = EndorNativeFunctionObject;
impl ObjectPayload for EndorNativeFunctionObject {
fn is_function(&self) -> bool {
true
}
fn reference_assignment_only(&self) -> bool {
true
}