Skip to content

Constraint Integral ([n]a) should imply a = Bit #760

@brianhuffman

Description

@brianhuffman

Cryptol infers what I consider to be a too-general type for expressions involving shift/indexing operators:

Cryptol> :t \x -> 0b01 << [x]
(\x -> 0b01 << [x]) : {a} (Integral ([1]a)) => a -> [2]
Cryptol> :t \x -> 0b01 @ [x]
(\x -> 0b01 @ [x]) : {a} (Integral ([1]a)) => a -> Bit

I would expect that the constraint Integral ([n]a) should improve to the type equality a = Bool, and then be discharged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    typecheckerIssues related to type-checking Cryptol code.wontfixFor issues that we've reviewed and decided do not require changes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions