No. Julia implements Union by storing a separate variable which tells which type the value has. The code then has branches, but no general type instability. You can check code stability yourself by using macro @code_warntype like @code_warntype f([1,2,3]).
1 Like