internal/workflow: correct type for constant, taskResult, expansionResult

The type was already correct for parameter and slice, but these three
had an extra slice on top of T. Thanks to Alan for noticing this during
the review of CL 709155.

Also switch to reflect.TypeFor in one more place.

Change-Id: I1fd2db001b0cbad1f13ba8ca342f98df75a2db29
Reviewed-on: https://go-review.googlesource.com/c/build/+/709516
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
diff --git a/internal/workflow/workflow.go b/internal/workflow/workflow.go
index dba91f3..ed436be 100644
--- a/internal/workflow/workflow.go
+++ b/internal/workflow/workflow.go
@@ -202,8 +202,7 @@
 
 func (p parameter[T]) valueType(T) {}
 func (p parameter[T]) typ() reflect.Type {
-	var zero T
-	return reflect.TypeOf(zero)
+	return reflect.TypeFor[T]()
 }
 func (p parameter[T]) value(w *Workflow) reflect.Value { return reflect.ValueOf(w.params[p.d.Name]) }
 func (p parameter[T]) ready(w *Workflow) bool          { return true }
@@ -303,7 +302,7 @@
 
 func (c *constant[T]) valueType(T) {}
 func (c *constant[T]) typ() reflect.Type {
-	return reflect.TypeFor[[]T]()
+	return reflect.TypeFor[T]()
 }
 func (c *constant[T]) value(_ *Workflow) reflect.Value { return reflect.ValueOf(c.v) }
 func (c *constant[T]) ready(_ *Workflow) bool          { return true }
@@ -434,7 +433,7 @@
 func (er *expansionResult[T]) valueType(T) {}
 
 func (er *expansionResult[T]) typ() reflect.Type {
-	return reflect.TypeFor[[]T]()
+	return reflect.TypeFor[T]()
 }
 
 func (er *expansionResult[T]) value(w *Workflow) reflect.Value {
@@ -622,7 +621,7 @@
 func (tr *taskResult[T]) valueType(T) {}
 
 func (tr *taskResult[T]) typ() reflect.Type {
-	return reflect.TypeFor[[]T]()
+	return reflect.TypeFor[T]()
 }
 
 func (tr *taskResult[T]) value(w *Workflow) reflect.Value {