`typeof(f(x))`

can be evaluated at compile-time, provided the return type of `f(x)`

is inferrable. Why can’t we have a guarantee that this is always the case?

For example, I tried this:

```
julia> f(x) = typeof(sin(x))
julia> @code_llvm debuginfo=:none f(5)
define nonnull %jl_value_t addrspace(10)* @julia_f_12432(i64) {
top:
%1 = sitofp i64 %0 to double
%2 = call double @julia_sin_12236(double %1)
ret %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140650398042128 to %jl_value_t*) to %jl_value_t addrspace(10)*)
}
```

As you can see, the call to `sin`

is not optimized away. Even though the type of `sin(5)`

is correctly inferred at compile time:

```
julia> @code_warntype f(5)
Body::Type{Float64}
1 ─ %1 = (Base.sitofp)(Float64, x)::Float64
│ invoke Base.Math.sin(%1::Float64)
└── return Float64
```