mirror of
https://github.com/luau-lang/rfcs.git
synced 2025-05-04 10:43:48 +01:00
Turn lua into luau
Co-authored-by: ariel <aweiss@hey.com>
This commit is contained in:
parent
74c149b534
commit
05e396d4b9
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ Implement type functions for `getmetatable` and `setmetatable`.
|
||||||
|
|
||||||
There is currently no way for users to apply metatable type information to a type without the usage of `typeof()`. This isn't ideal, as it adds verbosity and boilerplate to common patterns such as object-oriented programming. For example, the following:
|
There is currently no way for users to apply metatable type information to a type without the usage of `typeof()`. This isn't ideal, as it adds verbosity and boilerplate to common patterns such as object-oriented programming. For example, the following:
|
||||||
|
|
||||||
```lua
|
```luau
|
||||||
local clock = {}
|
local clock = {}
|
||||||
type Identity = typeof(setmetatable({} :: { time: number }, { __index = clock }))
|
type Identity = typeof(setmetatable({} :: { time: number }, { __index = clock }))
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue