Specify additional failure case for setmetatable

This commit is contained in:
ffrostfall 2025-02-04 18:57:28 -05:00 committed by GitHub
parent 71b58dc82d
commit f4e7b9577f
Signed by: DevComp
GPG key ID: B5690EEEBB952194

View file

@ -44,6 +44,7 @@ type Identity = setmetatable<{
When a non-table type (number, boolean) is passed into the type function, it should result in an error. This includes classes. When a non-table type (number, boolean) is passed into the type function, it should result in an error. This includes classes.
If the type is an intersection or union of tables, then the metatable should be applied to every component type. If the type is an intersection or union of tables, then the metatable should be applied to every component type.
If the second argument of the type function isn't a table, then it should error. If the second argument of the type function isn't a table, then it should error.
If the first argument of `setmetatable` has a metatable with the `__metatable` field specified, then it should also report an error.
### `getmetatable` Type Function ### `getmetatable` Type Function