title: Julia Type Parameters Nesting/Scope in Function Parameters
body: <p>Following up from a <a href="https://stackoverflow.com/q/54655864/7288706">question I posted earlier</a>, I am trying to understand the details of type parameter scope in function methods.<br>
  For example:</p>
  
  <pre><code>f(x::Vector{&lt;:Number}) = sum(x)
  g(x::Vector{T}) where T&lt;:Number = sum(x)
  </code></pre>
  
  <p>The <code>&lt;:Number</code> constraint covers only the argument list of <code>f</code>:</p>
  
  <pre><code>julia&gt; methods(f)
  f(x::Array{#s1,1} where #s1&lt;:Number)
  </code></pre>
  
  <p>but it seems that <code>g</code> is parameterized by it:</p>
  
  <pre><code>julia&gt; methods(g)
  g(x::Array{T,1}) where T&lt;:Number
  </code></pre>
  
  <p>Is there a reason why <a href="https://github.com/JuliaLang/julia/pull/20414#issuecomment-277110323" rel="nofollow noreferrer">"[y]ou generally want <code>T</code> to cover as little of the signature as possible"</a> aside from <a href="https://docs.julialang.org/en/v1/manual/style-guide/index.html#Don&#39;t-use-unnecessary-static-parameters-1" rel="nofollow noreferrer">style</a> and limiting <code>T</code>'s scope?<br>
  Are there any implications performance, dispatch, or code-generation wise?</p>