Refine documentation for class Any (#1194)

This commit is contained in:
Daniel Chao
2025-09-02 08:19:39 -07:00
committed by GitHub
parent bef0375285
commit a66ac0eb35
2 changed files with 284 additions and 258 deletions

View File

@@ -29,12 +29,14 @@ import "pkl:protobuf"
/// Every type is a subtype of [Any].
///
/// The following operators are supported for all values:
///
/// ```
/// value1 == value2 // equality
/// value1 != value2 // inequality
/// value.member // member access
/// value?.member // conditional member access; returns `value.member` if `value` is non-null and `null` otherwise
/// value ?? default // null coalescing; returns `value` if `value` is non-null and `default` otherwise
/// value!! // non-null assertion; throws if `value` is `null`, and returns `value` otherwise
/// value is String // type test
/// value as String // type cast; throws an error unless `value is String`
/// ```