Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
any
as the default function label type (#9050)
Currently, the default is `unknown`, but allowing `unknown` as a function label type value creates some complications. * The sets of allowed label types of a task and of a function are not the same, so we have to use different enums to represent them. * `any` and `unknown` have similar meanings, and it's not clear what the difference between them is unless you search the code (AFAIK it's not documented anywhere). The sole benefit of having a separate `unknown` label type seems to be that function labels of type `any` are only allowed to be mapped to task labels of type `any`, while function labels of type `unknown` can be mapped to task labels of any type. But it doesn't seem like a useful distinction. Functions with both `unknown` and `any` label types can produce any shape types, so if we allow one of them, it makes sense to also allow the other. In addition, functions that can produce _multiple_ shape types for a single label are probably going to be rare, so I think it's reasonable to assume that a function with an `any`-typed label will still produce a single shape type and therefore can be mapped to a label with a specific type (although the user is responsible for ensuring that the types actually match). To sum up, I don't think the additional complexity introduced by the `unknown` type is worth it. So let's remove it and use `any` instead. This PR keeps some `unknown`-related logic in the UI, since there's some code in the Enterprise backend that also uses `unknown` as a label type. If this patch is accepted, I'll replace those uses with `any` too, then go back and remove the remaining logic here.
- Loading branch information