This teaches the compiler to catch entries with duplicate fields, and duplicate meta entries, because it could be ambiguous to determine which should take precedence. For example, if you specified `content` to a file resource twice, this should error. This is known statically, so we can catch it. If you specified two `Meta:noop` entries, this can also be caught. The interesting part happens when you specify one `Meta:noop` entry, and one `Meta` entry which happens to contain a noop field in the struct. For this, we actually have to wait until type unification is finished, and catch the error there. This is because after type unification we will know the precise type of the struct being passed to `Meta`, and so we can look at its field names, even if their values aren't yet known because the graph hasn't run yet.
2 lines
59 B
Plaintext
2 lines
59 B
Plaintext
# err: errInit: resource has duplicate meta entry of: noop
|