Skip to content

Propagate types through some operations #615

@mkorbel1

Description

@mkorbel1

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions