Skip to content

Comparing two Byte values always result in True, regardless of the actual bytes #15

Open
elm/core
#1092
@malinoff

Description

@malinoff
> import Bytes.Encode
> b0 = [] |> List.map Bytes.Encode.unsignedInt8 |> Bytes.Encode.sequence |> Bytes.Encode.encode
<0 bytes> : Bytes.Bytes
> b1 = [ 125, 211, 143, 67, 78, 89, 125, 24, 100, 73, 61, 190, 172, 133, 160, 82, 150, 234, 82, 197, 97, 146, 67, 85, 53, 203, 134, 236, 168, 180, 179, 239 ] |> List.map Bytes.Encode.unsignedInt8 |> Bytes.Encode.sequence |> Bytes.Encode.encode
<32 bytes> : Bytes.Bytes
> (b0 == b1)
True : Bool

I'm not sure if it was ever intended to be able to compare two Bytes values, but the result of such comparison is very surprising.

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