From 8d3f485d14fae38898530b4680afe9cfbbfdfae5 Mon Sep 17 00:00:00 2001 From: "ajeffrey@roblox.com" Date: Wed, 5 Jan 2022 12:00:46 -0600 Subject: [PATCH] Added discussion of array-like tables --- rfcs/unsealed-table-literals.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rfcs/unsealed-table-literals.md b/rfcs/unsealed-table-literals.md index f220f632..3a3365fc 100644 --- a/rfcs/unsealed-table-literals.md +++ b/rfcs/unsealed-table-literals.md @@ -61,8 +61,16 @@ if foo then end ``` +In particular, we no longer warn about adding properties to array-like tables. +```lua +local a = {1,2,3} +a.p = 5 +``` + ## Alternatives We could introduce a new table state for unsealed-but-precise tables. The trade-off is that that would be more precise, at the cost of adding user-visible complexity to the type system. + +We could contine to treat array-like tables as sealed. \ No newline at end of file