Skip to content

deepErrorX behavior for Bit and BitVector n are differenct #2978

@lmbollen

Description

@lmbollen

AFAIK there's always been discussion on how undefinedness should work especially for BitVector n (whether it should produce an X exception or not)

But regardless of that I think that at least BitVector n and Bit should behave the same. Right now we have the following behavior:

ghci> deepErrorX "" :: Bit
*** Exception: X: 
CallStack (from HasCallStack):
  errorX, called at src/Clash/Sized/Internal/BitVector.hs:300:16 in clash-prelude-1.9.0-67fee7029a5493706dc3a40bc6492fe6aff05d8584aa3f56c3d3f55011874849:Clash.Sized.Internal.BitVector
  deepErrorX, called at <interactive>:36:1 in interactive:Ghci21
ghci> deepErrorX "" :: BitVector 8
0b...._....
ghci> Clash.Sized.Internal.BitVector.Bit 1 0 :: Bit
.
ghci> Clash.Sized.Internal.BitVector.BV 1 0 :: BitVector 8
0b0000_000.

I feel like whether or not undefined bits cause an X exception, at least Bit and BitVector n should behave the same

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions