Supporting typed, structured data #12388
mitchgrout
started this conversation in
Ideas
Replies: 1 comment
-
The ability to type-check values is still valuable in its own right, but does not really address the core problem I have here; it would resolve the error message being misleading, but would not tell me which row was causing the problem. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A common trick I see used to reduce duplicated declarations is to iterate over a set of data; this might be a hash where each key/value represents some 'configuration' of sorts. An example of this could be a hash representing tests to be built+run, with the configuration containing key data such as:
Since a hash can store any type as a value, and AFAIK there is no user-level type checking permitted, it's possible to mess up the config and get bizarre error messages out the other side. For example, I might have
Since there is no way to ensure that the value of
config.get('dependencies')
is alib
, I will get a complaint from meson about alib
being passed in thedependencies
field. However, the provenance is lost; I can't figure out from that message alone which row in thetests
hash caused the problem.My thoughts on this would be to either:
The first choice feels more accessible to me; the above example could possibly be something like...
This would provide better provenance for the error, as it would actually be at the creation site rather than the use site.
Beta Was this translation helpful? Give feedback.
All reactions