<p dir="auto">It's related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="130901064" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/14919" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/14919/hovercard" href="https://github.com/JuliaLang/julia/issues/14919">#14919</a>. The code</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="abstract FitnessScheme{F}
immutable MinimizingScalarScheme &lt;: FitnessScheme{Float64} end
is_better(x, y, fs::MinimizingScalarScheme) = x &lt; y

Base.call{F}(fs::FitnessScheme{F}, x::F, y::F) = is_better(x, y, fs)"><pre class="notranslate">abstract FitnessScheme{F}
immutable MinimizingScalarScheme <span class="pl-k">&lt;:</span> <span class="pl-c1">FitnessScheme{Float64}</span> <span class="pl-k">end</span>
<span class="pl-en">is_better</span>(x, y, fs<span class="pl-k">::</span><span class="pl-c1">MinimizingScalarScheme</span>) <span class="pl-k">=</span> x <span class="pl-k">&lt;</span> y

Base<span class="pl-k">.</span><span class="pl-en">call</span><span class="pl-c1">{F}</span>(fs<span class="pl-k">::</span><span class="pl-c1">FitnessScheme{F}</span>, x<span class="pl-k">::</span><span class="pl-c1">F</span>, y<span class="pl-k">::</span><span class="pl-c1">F</span>) <span class="pl-k">=</span> <span class="pl-c1">is_better</span>(x, y, fs)</pre></div>
<p dir="auto">works in v0.4, but in v0.5 I get</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="WARNING: deprecated syntax &quot;call(fs::FitnessScheme{F}, ...)&quot;.
Use &quot;(fs::FitnessScheme{F})(...)&quot; instead.
ERROR: cannot add methods to an abstract type
 in eval(::Module, ::Any) at ./boot.jl:267"><pre class="notranslate"><code class="notranslate">WARNING: deprecated syntax "call(fs::FitnessScheme{F}, ...)".
Use "(fs::FitnessScheme{F})(...)" instead.
ERROR: cannot add methods to an abstract type
 in eval(::Module, ::Any) at ./boot.jl:267
</code></pre></div>
<p dir="auto">The alternative approach (works in v0.4)</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Base.call{FS&lt;:FitnessScheme,F}(fs::FS, x::F, y::F) = is_better(x, y, fs)"><pre class="notranslate">Base<span class="pl-k">.</span><span class="pl-en">call</span><span class="pl-c1">{FS&lt;:FitnessScheme,F}</span>(fs<span class="pl-k">::</span><span class="pl-c1">FS</span>, x<span class="pl-k">::</span><span class="pl-c1">F</span>, y<span class="pl-k">::</span><span class="pl-c1">F</span>) <span class="pl-k">=</span> <span class="pl-c1">is_better</span>(x, y, fs)</pre></div>
<p dir="auto">also fails with</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="WARNING: deprecated syntax &quot;call(fs::FS, ...)&quot;.
Use &quot;(fs::FS)(...)&quot; instead.
ERROR: function type in method definition is not a type
 in eval(::Module, ::Any) at ./boot.jl:267"><pre class="notranslate"><code class="notranslate">WARNING: deprecated syntax "call(fs::FS, ...)".
Use "(fs::FS)(...)" instead.
ERROR: function type in method definition is not a type
 in eval(::Module, ::Any) at ./boot.jl:267
</code></pre></div>
<p dir="auto">The expected behaviour is that both definitions are valid.</p>
<p dir="auto">I'm updating ApproxFun and this caught me by surprise:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="abstract Foo
julia&gt; (f::Foo)(x)=x
ERROR: cannot add methods to an abstract type
 in eval(::Module, ::Any) at ./boot.jl:267"><pre class="notranslate">abstract Foo
julia<span class="pl-k">&gt;</span> (f<span class="pl-k">::</span><span class="pl-c1">Foo</span>)(x)<span class="pl-k">=</span>x
ERROR<span class="pl-k">:</span> cannot add methods to an <span class="pl-k">abstract type</span>
 <span class="pl-k">in</span> <span class="pl-c1">eval</span>(<span class="pl-k">::</span><span class="pl-c1">Module</span>, <span class="pl-k">::</span><span class="pl-c1">Any</span>) at <span class="pl-k">./</span>boot<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">267</span></pre></div>
<p dir="auto">Is this intentional?  Is there a way to get around this other than define for each subtype:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; immutable CFoo &lt;: Foo end
julia&gt; (f::CFoo)(x)=x"><pre class="notranslate">julia<span class="pl-k">&gt;</span> immutable CFoo <span class="pl-k">&lt;:</span> <span class="pl-c1">Foo</span> <span class="pl-k">end</span>
julia<span class="pl-k">&gt;</span> (f<span class="pl-k">::</span><span class="pl-c1">CFoo</span>)(x)<span class="pl-k">=</span>x</pre></div>