Skip to content

Typed.Bool.symbol, etc. don't check types at all #552

@sim642

Description

@sim642

Typed.Bool contains

let[@inline] symbol x = Expr.symbol x

Not only does it not check the symbol type at compile time, it also doesn't check at runtime!
So Smtml is completely happy with

Typed.Bool.symbol (Symbol.make Ty_int "x")

This defeats the point of the Typed interface because all the safety it provides can be just bypassed.
These inner symbol functions should at least check the types at runtime.

And if this check is unnecessarily expensive for some use case, I guess there could be Typed.Unsafe.Bool.symbol with the current unchecked definition.

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