Validating exact fields of object literals #3058
EvanBalster
started this conversation in
General
Replies: 1 comment 1 reply
-
Yes, you overlooked that there are already issues reporting this: 😂
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to define a type for an object literal for a table representing miscellaneous extra options in a function. Currently I've defined the type like so in a
@meta
file.This type is then used as an optional argument to this function: (this is a bound C++ function so again, only
@meta
info)The problem is that this doesn't seem to validate
{
object literals}
. Marking theScanOptions
class as(exact)
will flag any rogue assignment but won't give any warning about invalid fields in the brace-initialized object:The diagnostics will complain if I try to initialize a field with the wrong type (eg,
line_of_sight=1
). But no respect for that(exact)
flag. Did I overlook something?Beta Was this translation helpful? Give feedback.
All reactions