Skip to content

Commit a0b7b51

Browse files
committed
Accept any value for any and unknown outputs
This is for instance needed with the property-setter/getter
1 parent c638fe1 commit a0b7b51

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

core/outputs.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,19 @@ func (n *Outputs) SetOutputValue(ec *ExecutionState, outputId OutputId, value an
164164
}
165165

166166
func isValueValidForOutput(value any, expectedType string) bool {
167+
168+
if expectedType == "any" || expectedType == "unknown" {
169+
return true
170+
}
171+
172+
// if its not unknown or any but nil then the value is not compatible
167173
if value == nil {
168174
return false
169175
}
170176

171177
valueType := reflect.TypeOf(value)
172178
kind := valueType.Kind()
173179

174-
if expectedType == "any" || expectedType == "unknown" {
175-
return true
176-
}
177-
178180
_, mappingExists := validKindsForExpectedType[expectedType]
179181
if mappingExists {
180182
_, valid := validKindsForExpectedType[expectedType][kind]

0 commit comments

Comments
 (0)