Motivation
After #614, it opens the door to making some matching outputs based on inputs. For example, mux, flop, and cases could potentially output the same type as the sources. It would be nice to add this functionality.
Desired solution
Parameterize things like mux, flop, and cases, and look for more, so that the output type matches the original input type.
Alternatives considered
No response
Additional details
There's some trickiness when there are multiple input types. flop is easy, but mux has two inputs. Which should it use? What if one of them is Const and you picked that one? Should it only try to match output if all of the inputs are the same type? Can we properly check that in Dart's type system?
Motivation
After #614, it opens the door to making some matching outputs based on inputs. For example,
mux,flop, andcasescould potentially output the same type as the sources. It would be nice to add this functionality.Desired solution
Parameterize things like
mux,flop, andcases, and look for more, so that the output type matches the original input type.Alternatives considered
No response
Additional details
There's some trickiness when there are multiple input types.
flopis easy, butmuxhas two inputs. Which should it use? What if one of them isConstand you picked that one? Should it only try to match output if all of the inputs are the same type? Can we properly check that in Dart's type system?