Skip to content

ModelOutputThunk should not be a CBlock #269

@nrfulton

Description

@nrfulton

Justification: Python pattern matching is based on order not specificity, so the following code never makes it into the second branch.

match span:
  case CBlock():
    handle cblocks generically
  case ModelOutputThunk():
    handle mots in particular
  case Component():
    handle more complex stuff

This is a footgun. The easiest solution is to simply remove mot from the cblock type hierarchy. There are no disadvanatges: anywhere we expect a cblock or a mot we should be explicit about that with a union type anyways, because mot.value is semantically different from cb.value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions