Update constrained-generics.md

This commit is contained in:
T 'Filtered' C 2023-01-23 22:41:31 +00:00 committed by GitHub
parent 9a4225210f
commit 49822e765c
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,6 +52,14 @@ Enum {"None", "Some", "All"} -- Not OK (generic must be have string keys)
Enum(0) -- Not ok (generic must be a table)
```
Finally, this will also give the autocomplete the correct information about the Enum, correctly containing the "None", "Some" and "All" keys
```lua
Enum. --> GetEnumItems: (Enum) -> {None: number, Some: number, All: number}
--> None: number
--> Some: number
--> All: number
```
## Drawbacks
More of the complexity budget spent.