Deprecated T.command(task)
for removal in Mill 0.13
#3524
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
T.command
currently has two overloads, one accepting aResult
(like most of the other task factories,T
,T.input
,T.task
and so on) and one accepting aTask
. Because of the second version, command definitions like the following don't do what the user thinks they do, although they seem to work.Instead of creating a new command that depends on another command (the
super
-version) and returns just the result, it returns thesuper
-command as-is.The correct version is:
This change deprecates all overloads accepting a
Task
in favor of accepting aResult
.Result
s can be easily acquired from aTask
by callingapply()
or short()
.This is also the more correct way of re-using or re-defining tasks, since directly re-used tasks may result in an incorrect tasks context, esp. an incorrect source location, which is relevant when debugging misbehaving builds.
See #3517