This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory-site.git

commit 09238ef4ef664b00eff0b9a220ca6d8af8576784
Author: chaokunyang <[email protected]>
AuthorDate: Fri May 15 11:56:33 2026 +0000

    🔄 synced local 'docs/guide/' with remote 'docs/guide/'
---
 docs/guide/scala/schema-idl.md               | 5 ++++-
 docs/guide/xlang/field-reference-tracking.md | 6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/docs/guide/scala/schema-idl.md b/docs/guide/scala/schema-idl.md
index 7f7dd6cf33..f89e81e76a 100644
--- a/docs/guide/scala/schema-idl.md
+++ b/docs/guide/scala/schema-idl.md
@@ -91,11 +91,14 @@ final class Node() derives ForySerializer {
 
   @Ref
   @ForyField(id = 2)
-  var parent: Option[Node @Ref] = None
+  var parent: Option[Node] = None
 }
 ```
 
 `@Ref` is the JVM reference-tracking annotation for Scala macro and IDL APIs.
+Use field or constructor-parameter `@Ref` for a top-level `ref T` field. Use
+type-use `T @Ref` only for nested element/value/payload refs, such as
+`list<ref T>`.
 
 Generated xlang collection fields use immutable Scala collection types:
 `List[T]`, `Set[T]`, and `Map[K, V]`. The runtime xlang serializers can also
diff --git a/docs/guide/xlang/field-reference-tracking.md 
b/docs/guide/xlang/field-reference-tracking.md
index a580cd2070..7bce185926 100644
--- a/docs/guide/xlang/field-reference-tracking.md
+++ b/docs/guide/xlang/field-reference-tracking.md
@@ -210,10 +210,14 @@ final class Node() derives ForySerializer {
 
   @Ref
   @ForyField(id = 2)
-  var parent: Option[Node @Ref] = None
+  var parent: Option[Node] = None
 }
 ```
 
+For Scala, top-level field reference tracking is owned by `@Ref` on the field 
or
+constructor parameter. Type-use `T @Ref` is for nested element/value/payload
+references, such as `List[Node @Ref]`.
+
 #### Go: Struct Tags
 
 ```go


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to