Skip to content

Typed calls can execute once per accepting declaration or type witness #312

Open

Description

@godelclaw

A type declaration can multiply a call's answers and side effects. For example:

(: either (-> Atom %Undefined%))
(: either (-> Number %Undefined%))
(= (either $x) (called $x))
!(collapse (either 7))

Both stable and main can return ((called 7) (called 7)). The same duplication affects a body that updates state. On stable, a value with several types can also repeat the body under a single polymorphic declaration.

The intended behavior is one execution per distinct argument-value binding, with type declarations determining admission and filtering each result. Distinct body answers and bindings introduced by relational type checks must remain distinct; multiple proofs of the same check should not repeat the call.

The stable and main implementations need separate changes because stable uses runtime type queries while main also has overload dispatch and delayed type requirements.

PR #156 addressed repeated identical signatures. This reproduction uses different signatures that both accept the call.

Proposed fixes: #313 targets stable; #314 targets main.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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