(* ProVerif 2.02pl1 Produces "Internal error: unexpected link in copy_binder" *)

type mytype.

event Event1().
query event(Event1()).

event Event2().
query event(Event2()).           (* The error appears even after removing this query *)

table table1(mytype).

let SubProcess1(foo:mytype) =     (* Do some stuff *)
    event Event1();
    insert table1(foo).

let SubProcess2(bar:mytype) =     (* Do other stuff *)
    0.

let Device(foo:mytype) =
    (SubProcess1(foo)
    | SubProcess2(foo)).

process
    !(new x:mytype;
      Device(x)
      )

(* EXPECTPV
RESULT not event(Event1) is false.
RESULT not event(Event2) is true.
0.008s (user 0.008s + system 0.000s), max rss 7184K
END *)
