diff --git a/docs/user-defined-type-functions.md b/docs/user-defined-type-functions.md index 8a68388..7d1ae51 100644 --- a/docs/user-defined-type-functions.md +++ b/docs/user-defined-type-functions.md @@ -69,7 +69,7 @@ Note: we are aware that for loops can cause infinite runtime. For the time being -To give warnings, developers can use `print()` with custom warning messages. To fail reductions, developers can use `error()` with custom error messages. If nothing is returned by the type function, it will fail to reduce with the default message: "Failed to reduce \ type function with no return values". +To give warnings, developers can use `print()` with custom warning messages. To fail reductions, developers can use `error()` with custom error messages. If nothing is returned by the type function, it will fail to reduce with the default message: "Failed to reduce \ type function with no return value". If the return value of the type function is not an instance of typelib, it will fail to reduce with the message: "Failed to reduce \ type function with non-typelib return value". To allow Luau developers to modify the runtime values of types in type functions, this RFC proposes introducing a new userdata called `typelib`. A `typelib` object is a runtime representation of all types within the program and provides a basic set of library methods that can be used to modify types. As such, under the hood, the `typelib` library will closely mimic the implementation of static types in Luau Analysis. Most importantly, they are *only accessible within type functions* and are *not a runtime type for other use cases than type functions*.