Add this as a self type (#1708)

This commit is contained in:
Jen Basch
2026-09-02 09:04:15 -07:00
committed by GitHub
parent 1208fa9438
commit 2b697015c7
305 changed files with 1487 additions and 561 deletions
+2 -2
View File
@@ -46,7 +46,7 @@ import "pkl:yaml"
/// ```
abstract external class Any {
/// Returns the class of [this].
external function getClass(): Class
external function getClass(): Class<this>
/// Returns a string representation of [this].
///
@@ -57,7 +57,7 @@ abstract external class Any {
///
/// This method is the complement of the `??` operator and the equivalent of an `Option` type's
/// `map` and `flatMap` methods.
external function ifNonNull<Result>(transform: (NonNull) -> Result): Result?
external function ifNonNull<Result>(transform: (this) -> Result): Result?
}
/// The type of [null] and null values created with [Null()].