# Function Parameter Speculation #17168

**URL:** https://discourse.julialang.org/t/function-parameter-speculation-17168/1677
**Category:** Internals & Design
**Created:** [January 25, 2017, 4:01am UTC](https://discourse.julialang.org/t/function-parameter-speculation-17168/1677 "2017-01-25T04:01:51Z")
**Posts on this page:** 1
**Showing post:** 28

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [May 18, 2017, 7:52pm UTC](https://discourse.julialang.org/t/function-parameter-speculation-17168/1677/28 "2017-05-18T19:52:39Z")

</div>

> [@tbenst](#):
>
> If 1+“hi” is a type error, so is sin ∘ string

Julia only gives “type errors” when you _evaluate_ the code that exhibits the problem. The reason `1 + "hi"` throws immediately is because when you evaluate that, it’s already a problem. When you evaluate `sin ∘ string` there’s no problem – the problem only occurs when you actually try to call that composite function on something. And the way Julia works, maybe it doesn’t – this is a perfectly valid if questionably useful program:

```julia
julia> ss = sin ∘ string
(::#55) (generic function with 1 method)

julia> Base.string(n::Int) = n

julia> ss(123)
-0.45990349068959124

```

You can’t generally know if a function composition is “well typed” when it occurs. You can only know that when it runs. We could potentially have a subset of behaviors which, if you follow them, allow compile-time checking that a problem doesn’t have any method errors, but that’s a project for some time in the future (post-1.0).

---

_[View the full topic](https://discourse.julialang.org/t/function-parameter-speculation-17168/1677)._
