mirror of
https://github.com/luau-lang/rfcs.git
synced 2025-04-19 19:34:00 +01:00
Motivation grammar fix
This commit is contained in:
parent
6241ae4afc
commit
960e34e233
1 changed files with 2 additions and 4 deletions
|
@ -6,9 +6,7 @@ This RFC proposes allowing strings as keys for methods on the `table` type userd
|
||||||
|
|
||||||
## Motivation
|
## Motivation
|
||||||
|
|
||||||
Currently having to always wrap string literal keys in `types.singleton` is annoying, and becomes especially annoying when using `types.newtable` due to having to write `[types.singleton("key")]` for every single key in the props table.
|
Currently having to always wrap string literal keys in `types.singleton` is annoying, and becomes especially annoying when using `types.newtable` due to having to write something like the following:
|
||||||
|
|
||||||
This leads to developers having to write the following:
|
|
||||||
|
|
||||||
```luau
|
```luau
|
||||||
types.newtable({
|
types.newtable({
|
||||||
|
@ -17,7 +15,7 @@ types.newtable({
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
When the following could be written instead, if it were allowed:
|
Instead of:
|
||||||
|
|
||||||
```luau
|
```luau
|
||||||
types.newtable({
|
types.newtable({
|
||||||
|
|
Loading…
Add table
Reference in a new issue