mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Minor fixes
This commit is contained in:
parent
5470f2a264
commit
54308d7472
1 changed files with 3 additions and 3 deletions
|
@ -146,7 +146,7 @@ and propose allowing explicit declaration of the shared self type,
|
||||||
following the common practice of naming the self type after the metatable:
|
following the common practice of naming the self type after the metatable:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
type Set<E> = { [E] : boolean }
|
type Set<E> = { elements : { [E] : boolean } }
|
||||||
```
|
```
|
||||||
|
|
||||||
This type (and its generic type parameters) are used to derive the
|
This type (and its generic type parameters) are used to derive the
|
||||||
|
@ -155,7 +155,7 @@ declarations:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
type SetSelf<E> = {
|
type SetSelf<E> = {
|
||||||
[E] : boolean,
|
elements : { [E] : boolean },
|
||||||
@metatable SetMT
|
@metatable SetMT
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -229,7 +229,7 @@ In calls to `setmetatable(t, mt)`:
|
||||||
* then `setmetatable(t, mt)` has type `S [ Ts/As ]`.
|
* then `setmetatable(t, mt)` has type `S [ Ts/As ]`.
|
||||||
|
|
||||||
As currently, this has a side-effect of updating the type state of `t` from
|
As currently, this has a side-effect of updating the type state of `t` from
|
||||||
'T [ Ts/As ]` to `S [ Ts/As ]`.
|
`T [ Ts/As ]` to `S [ Ts/As ]`.
|
||||||
|
|
||||||
For example, in `setmetatable({ elements = {} }, Set)`, we have:
|
For example, in `setmetatable({ elements = {} }, Set)`, we have:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue