You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that SE-0252 has been accepted, we should try to adopt @dynamicMemberLookup in ConsoleKit:
letfoo=try context.option(\.foo)// could becomeletfoo= context.options.foo
Conformance to @dynamicMemberLookup should be fairly straightforward except for one issue: throwing. Since @dynamicMemberLookup will result in a subscript / computed-property for the given key path, we will not be able to throw. To remedy this, we can insert an "input validation" step before the command actually runs. In this step, we would ensure any supplied arguments / options have been converted to their desired types and store them. Then the member lookup could be done once the command runs without throwing. (Even if we don't decide to adopt @dynamicMemberLookup, this early validation step could be a nice addition)
The text was updated successfully, but these errors were encountered:
Now that SE-0252 has been accepted, we should try to adopt
@dynamicMemberLookup
in ConsoleKit:Conformance to
@dynamicMemberLookup
should be fairly straightforward except for one issue: throwing. Since@dynamicMemberLookup
will result in a subscript / computed-property for the given key path, we will not be able to throw. To remedy this, we can insert an "input validation" step before the command actually runs. In this step, we would ensure any supplied arguments / options have been converted to their desired types and store them. Then the member lookup could be done once the command runs without throwing. (Even if we don't decide to adopt@dynamicMemberLookup
, this early validation step could be a nice addition)The text was updated successfully, but these errors were encountered: