Revised wording for motivation section

Co-authored-by: aaron <aweiss@hey.com>
This commit is contained in:
Junseo Yoo 2024-06-13 16:11:37 -07:00 committed by GitHub
parent 960a1f7a4a
commit 2126e5c0d2
Signed by: DevComp
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,7 @@ This RFC proposes the addition of a new type operator, `rawget`, which can be us
## Motivation
Given that `rawget` is a built-in runtime operator in the language ([rawget in Luau Global functions](https://luau-lang.org/library#global-functions)), it feels natural for there to be a version of this as a type operator. As such, the main motivation behind this feature is to close out holes in Luau's type families and allow Luau developers to be more expressive writing typed code:
Currently, `rawget` is a built-in runtime operator in the language ([rawget in Luau Global functions](https://luau-lang.org/library#global-functions)) that is missing a corresponding type operator that captures its behavior. This RFC seeks to address this hole in the type system by providing a builtin type operator for `rawget` that will allow Luau developers to express more accurate types in their code:
```luau
local prop: rawget<someTy, someProp> = rawget(someTy, someProp)