Torchscript Loop: type mismatch

This is dump() result from a torchscript model.

%hidden0 : (Tensor, Tensor)?, %not_blank : bool, %symbols_added : int = prim::Loop(%348, %132, %hidden.7, %132, %151) 
  block0(%351 : int, %hidden0.15 : (Tensor, Tensor)?, %not_blank.7 : bool, %symbols_added.5 : int):
          .....
         %775 : bool = prim::If(%not_blank0)
         block0():
           %723 : bool = aten::lt(%symbols_added0.1, %722)
         -> (%723)
        block1():
        -> (%134)
  -> (%775, %hidden3, %not_blank0, %symbols_added0.1

the return value %775 is a bool type, but the block of loop requires a int type.
It 's allowed?