Function pointer with IN keyword and Arrays



IN keword with function pointer and Dynamic Array
Pas2JS pascal source code
type TProc = procedure; { unit1.pas unit } var a: array of TProc; proc: TProc; procedure Dummy; begin {just to test} end; procedure Test; begin {just to test} end; begin if Dummy in a then Writeln('bug1'); proc := Dummy; A.Add(proc); if proc not in a then Writeln('bug2'); if Dummy in a then Writeln('ok'); { ok } { unit2.pas unit } a.add(proc); If nil In a Then writeln('0'); If proc In a Then writeln('1'); If @proc In a Then writeln('2'); If Test In a Then writeln('bug1'); If @Test In a Then writeln('bug2'); { 0 1 2 }