Skip to content

spurious warning for Switch over 0-width value #1133

Closed
@wanda-phi

Description

@wanda-phi
m = Module()
sw = Signal(0)
output = Signal()
with m.Switch(sw):
    with m.Case(0):
        m.d.comb += output.eq(1)

results in:

SyntaxWarning: Case pattern '0' (1'0) is wider than switch value (which has width 0); comparison will never be true

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