would not give any indication that the parameter bogus doesn't exist. This is dangerous because users can set parameters expecting them to do something, while they actually don't.
Design
This would require a parameter to be "declared" via add*Param before it is set. Perhaps this could be achieved with a new Metadata member _added, which defaults to false. The add*Param methods would set this to true, and set would throw an error if false.
Some parameters are "private", i.e., not to be seen/set in an input file, but there is a method addPrivateParam that should be called for these.
Impact
More strict input parameter behavior. We could discover some parameters that were set but never added.
Motivation
When you set input parameters from code instead of from the input file, you can set parameters that don't actually exist or do anything. For example,
would not give any indication that the parameter
bogus
doesn't exist. This is dangerous because users can set parameters expecting them to do something, while they actually don't.Design
This would require a parameter to be "declared" via
add*Param
before it isset
. Perhaps this could be achieved with a newMetadata
member_added
, which defaults tofalse
. Theadd*Param
methods would set this totrue
, andset
would throw an error iffalse
.Some parameters are "private", i.e., not to be seen/set in an input file, but there is a method
addPrivateParam
that should be called for these.Impact
More strict input parameter behavior. We could discover some parameters that were set but never added.