+ @Tranient for serialization

This commit is contained in:
sergeych committed 2026-01-16 07:47:27 +03:00
1 parent 05e15e8e42
commit b7dfda2f5d
14 files changed
+450 -54

No files matched your search

+15
View File
@@ -171,6 +171,21 @@ settings["theme"] ?= "dark"
The operator returns the final value of the receiver (the original value if it was not `null`, or the new value if the assignment occurred).
### Transient Attribute (`@Transient`)
The `@Transient` attribute can now be applied to class fields, constructor parameters, and static fields to exclude them from serialization.
```lyng
class MyData(@Transient val tempSecret, val publicData) {
@Transient var cachedValue = 0
var persistentValue = 42
}
```
Key features:
- **Serialization**: Transient members are omitted from both Lynon binary streams and JSON output.
- **Structural Equality**: Transient fields are automatically ignored during `==` equality checks.
- **Deserialization**: Transient constructor parameters with default values are correctly restored to those defaults upon restoration.
## Tooling and Infrastructure
### CLI: Formatting Command