bloom-lang / bud

Prototype Bud runtime (Bloom Under Development)
http://bloom-lang.net
Other
854 stars 60 forks source link

Join predicate error checking #191

Closed neilconway closed 13 years ago

neilconway commented 13 years ago

Here's a buggy statement:

    msg_recv <~ (new_msg * node_status * attempt_status).combos(msg_send.recv_node => node_status.node_id, node_status.attempt_id => attempt_status.attempt_id) do |m, ns, as|
      [as.addr, m.recv_id, m.recv_node, m.send_node, m.payload] if as.status == ATTEMPT_LIVE
    end

The bug is that I had replaced msg_send with new_msg in the join constructor (starred list), but not in the join conditions. Bud silently executes this code, but it produces weird outputs (I'm guessing because it is projecting against tuples with an unexpected schema).

Expected behavior: Bud should flag this error, either at syntax-check time (preferrable) or at run-time (good enough).