Why effect inference fails?

Why is it unsure about nothrow?

julia> f(x) = x * x
f (generic function with 1 method)

julia> Base.infer_effects(*, (Int, Int))
(+c,+e,+n,+t)

julia> Base.infer_effects(f, (Int, Int))
(+c,+e,?n,+t)

julia> versioninfo()
Julia Version 1.8.1
Commit afb6c60d69a (2022-09-06 15:09 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 24 × AMD Ryzen 9 3900XT 12-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, znver2)
  Threads: 1 on 24 virtual cores
Environment:
  LD_LIBRARY_PATH = 

Probably because you got signature wrong, your f takes a single argument, not two.

2 Likes