<p dir="auto">Abstract and concrete parametric types can inherit from other parametric types with contradictory type constraints for example:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; abstract type A{T&lt;:Int} end

julia&gt; abstract type B{T&lt;:Array} &lt;: A{T} end

julia&gt; struct C{T} &lt;: B{T}
                f::T
              end"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-k">abstract type</span> A{T<span class="pl-k">&lt;:</span><span class="pl-c1">Int</span>} <span class="pl-k">end</span>

julia<span class="pl-k">&gt;</span> <span class="pl-k">abstract type</span> B{T<span class="pl-k">&lt;:</span><span class="pl-c1">Array</span>} <span class="pl-k">&lt;:</span> <span class="pl-c1">A{T}</span> <span class="pl-k">end</span>

julia<span class="pl-k">&gt;</span> <span class="pl-k">struct</span> C{T} <span class="pl-k">&lt;:</span> <span class="pl-c1">B{T}</span>
                f<span class="pl-k">::</span><span class="pl-c1">T</span>
              <span class="pl-k">end</span></pre></div>
<p dir="auto">None of these types can ever be used</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; B{Array}
ERROR: TypeError: in A, in T, expected T&lt;:Int64, got Type{Array}
Stacktrace:
 [1] top-level scope at none:0

julia&gt; B{Int}
ERROR: TypeError: in B, in T, expected T&lt;:Array, got Type{Int64}
Stacktrace:
 [1] top-level scope at none:0

julia&gt; C(3)
ERROR: TypeError: in B, in T, expected T&lt;:Array, got Type{Int64}
Stacktrace:
 [1] C(::Int64) at ./REPL[3]:2
 [2] top-level scope at none:0

julia&gt; c([3])
ERROR: UndefVarError: c not defined
Stacktrace:
 [1] top-level scope at none:0

julia&gt; versioninfo()
Julia Version 1.0.1
Commit 0d713926f8 (2018-09-29 19:05 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)"><pre class="notranslate">julia<span class="pl-k">&gt;</span> B{Array}
ERROR<span class="pl-k">:</span> TypeError<span class="pl-k">:</span> <span class="pl-k">in</span> A, <span class="pl-k">in</span> T, expected T<span class="pl-k">&lt;:</span><span class="pl-c1">Int64</span>, got Type{Array}
Stacktrace<span class="pl-k">:</span>
 [<span class="pl-c1">1</span>] top<span class="pl-k">-</span>level scope at none<span class="pl-k">:</span><span class="pl-c1">0</span>

julia<span class="pl-k">&gt;</span> B{Int}
ERROR<span class="pl-k">:</span> TypeError<span class="pl-k">:</span> <span class="pl-k">in</span> B, <span class="pl-k">in</span> T, expected T<span class="pl-k">&lt;:</span><span class="pl-c1">Array</span>, got Type{Int64}
Stacktrace<span class="pl-k">:</span>
 [<span class="pl-c1">1</span>] top<span class="pl-k">-</span>level scope at none<span class="pl-k">:</span><span class="pl-c1">0</span>

julia<span class="pl-k">&gt;</span> <span class="pl-c1">C</span>(<span class="pl-c1">3</span>)
ERROR<span class="pl-k">:</span> TypeError<span class="pl-k">:</span> <span class="pl-k">in</span> B, <span class="pl-k">in</span> T, expected T<span class="pl-k">&lt;:</span><span class="pl-c1">Array</span>, got Type{Int64}
Stacktrace<span class="pl-k">:</span>
 [<span class="pl-c1">1</span>] <span class="pl-c1">C</span>(<span class="pl-k">::</span><span class="pl-c1">Int64</span>) at <span class="pl-k">./</span>REPL[<span class="pl-c1">3</span>]<span class="pl-k">:</span><span class="pl-c1">2</span>
 [<span class="pl-c1">2</span>] top<span class="pl-k">-</span>level scope at none<span class="pl-k">:</span><span class="pl-c1">0</span>

julia<span class="pl-k">&gt;</span> <span class="pl-c1">c</span>([<span class="pl-c1">3</span>])
ERROR<span class="pl-k">:</span> UndefVarError<span class="pl-k">:</span> c not defined
Stacktrace<span class="pl-k">:</span>
 [<span class="pl-c1">1</span>] top<span class="pl-k">-</span>level scope at none<span class="pl-k">:</span><span class="pl-c1">0</span>

julia<span class="pl-k">&gt;</span> <span class="pl-c1">versioninfo</span>()
Julia Version <span class="pl-c1">1.0</span>.<span class="pl-c1">1</span>
Commit <span class="pl-c1">0</span>d713926f8 (<span class="pl-c1">2018</span><span class="pl-k">-</span><span class="pl-c1">09</span><span class="pl-k">-</span><span class="pl-c1">29</span> <span class="pl-c1">19</span><span class="pl-k">:</span><span class="pl-c1">05</span> UTC)
Platform Info<span class="pl-k">:</span>
  OS<span class="pl-k">:</span> macOS (x86_64<span class="pl-k">-</span>apple<span class="pl-k">-</span>darwin14.<span class="pl-c1">5.0</span>)
  CPU<span class="pl-k">:</span> <span class="pl-c1">Intel</span>(R) <span class="pl-c1">Core</span>(TM) i7<span class="pl-k">-</span><span class="pl-c1">4770</span>HQ CPU @ <span class="pl-c1">2.20</span>GHz
  WORD_SIZE<span class="pl-k">:</span> <span class="pl-c1">64</span>
  LIBM<span class="pl-k">:</span> libopenlibm
  LLVM<span class="pl-k">:</span> libLLVM<span class="pl-k">-</span><span class="pl-c1">6.0</span>.<span class="pl-c1">0</span> (ORCJIT, haswell)</pre></div>
<p dir="auto">Suppose we have the following definitions</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#type this into session 1
abstract Domain{T&lt;:Number}
immutable Interval{T} &lt;: Domain{T}
    a::T
    b::T
end"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span>type this into session 1</span>
abstract Domain{T<span class="pl-k">&lt;:</span><span class="pl-c1">Number</span>}
immutable Interval{T} <span class="pl-k">&lt;:</span> <span class="pl-c1">Domain{T}</span>
    a<span class="pl-k">::</span><span class="pl-c1">T</span>
    b<span class="pl-k">::</span><span class="pl-c1">T</span>
<span class="pl-k">end</span></pre></div>
<p dir="auto">For the purposes of this issue I expect the following block of code to work exactly as the above (if you type them each into a different Julia session). Perhaps this is not a justified expectation.</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#type this into session 2
immutable Interval{T&lt;:Number} 
    a::T
    b::T
end"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span>type this into session 2</span>
immutable Interval{T<span class="pl-k">&lt;:</span><span class="pl-c1">Number</span>} 
    a<span class="pl-k">::</span><span class="pl-c1">T</span>
    b<span class="pl-k">::</span><span class="pl-c1">T</span>
<span class="pl-k">end</span></pre></div>
<p dir="auto">In both sessions, this works as expected</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; Interval{Float64}(3,4)
Interval{Float64}(3.0,4.0)

julia&gt; Interval(&quot;he&quot;,&quot;llo&quot;)
ERROR: type: Domain: in T, expected T&lt;:Number, got Type{ASCIIString}"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">Interval</span><span class="pl-c1">{Float64}</span>(<span class="pl-c1">3</span>,<span class="pl-c1">4</span>)
<span class="pl-c1">Interval</span><span class="pl-c1">{Float64}</span>(<span class="pl-c1">3.0</span>,<span class="pl-c1">4.0</span>)

julia<span class="pl-k">&gt;</span> <span class="pl-c1">Interval</span>(<span class="pl-s"><span class="pl-pds">"</span>he<span class="pl-pds">"</span></span>,<span class="pl-s"><span class="pl-pds">"</span>llo<span class="pl-pds">"</span></span>)
ERROR<span class="pl-k">:</span> type<span class="pl-k">:</span> Domain<span class="pl-k">:</span> <span class="pl-k">in</span> T, expected T<span class="pl-k">&lt;:</span><span class="pl-c1">Number</span>, got Type{ASCIIString}</pre></div>
<p dir="auto">but if you go on to define in each session</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Interval(a::Number,b::Number) = Interval(promote(a,b)...)"><pre class="notranslate"><span class="pl-en">Interval</span>(a<span class="pl-k">::</span><span class="pl-c1">Number</span>,b<span class="pl-k">::</span><span class="pl-c1">Number</span>) <span class="pl-k">=</span> <span class="pl-c1">Interval</span>(<span class="pl-c1">promote</span>(a,b)<span class="pl-k">...</span>)</pre></div>
<p dir="auto">then session 1 loops on <code class="notranslate">Interval(3,4.)</code> (and any number types) but it works as I expect in session 2.<br>
This is consistent with the following</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#session 1 
julia&gt; methods(Interval)
#2 methods for generic function &quot;Interval&quot;:
Interval(a::Number,b::Number) at none:1
Interval{T}(a::T,b::T)"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span>session 1 </span>
julia<span class="pl-k">&gt;</span> <span class="pl-c1">methods</span>(Interval)
<span class="pl-c"><span class="pl-c">#</span>2 methods for generic function "Interval":</span>
<span class="pl-c1">Interval</span>(a<span class="pl-k">::</span><span class="pl-c1">Number</span>,b<span class="pl-k">::</span><span class="pl-c1">Number</span>) at none<span class="pl-k">:</span><span class="pl-c1">1</span>
<span class="pl-c1">Interval</span><span class="pl-c1">{T}</span>(a<span class="pl-k">::</span><span class="pl-c1">T</span>,b<span class="pl-k">::</span><span class="pl-c1">T</span>)</pre></div>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#session 2
julia&gt; methods(Interval)
#2 methods for generic function &quot;Interval&quot;:
Interval{T&lt;:Number}(a::T&lt;:Number,b::T&lt;:Number)
Interval(a::Number,b::Number) at none:1"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span>session 2</span>
julia<span class="pl-k">&gt;</span> <span class="pl-c1">methods</span>(Interval)
<span class="pl-c"><span class="pl-c">#</span>2 methods for generic function "Interval":</span>
<span class="pl-c1">Interval</span><span class="pl-c1">{T&lt;:Number}</span>(a<span class="pl-k">::</span><span class="pl-c1">T</span><span class="pl-k">&lt;:</span><span class="pl-c1">Number</span>,b<span class="pl-k">::</span><span class="pl-c1">T</span><span class="pl-k">&lt;:</span><span class="pl-c1">Number</span>)
<span class="pl-c1">Interval</span>(a<span class="pl-k">::</span><span class="pl-c1">Number</span>,b<span class="pl-k">::</span><span class="pl-c1">Number</span>) at none<span class="pl-k">:</span><span class="pl-c1">1</span></pre></div>
<p dir="auto">The solution seems to be to be redundant</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#type this into session 1
abstract Domain{T&lt;:Number}
immutable Interval{T&lt;:Number} &lt;: Domain{T}
    a::T
    b::T
end"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span>type this into session 1</span>
abstract Domain{T<span class="pl-k">&lt;:</span><span class="pl-c1">Number</span>}
immutable Interval{T<span class="pl-k">&lt;:</span><span class="pl-c1">Number</span>} <span class="pl-k">&lt;:</span> <span class="pl-c1">Domain{T}</span>
    a<span class="pl-k">::</span><span class="pl-c1">T</span>
    b<span class="pl-k">::</span><span class="pl-c1">T</span>
<span class="pl-k">end</span></pre></div>
<p dir="auto">Furthermore, I think this should raise some kind of red text</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#a new session
abstract Domain{T&lt;:Number}
immutable Interval{T&lt;:String} &lt;: Domain{T}
    a::T
    b::T
end"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span>a new session</span>
abstract Domain{T<span class="pl-k">&lt;:</span><span class="pl-c1">Number</span>}
immutable Interval{T<span class="pl-k">&lt;:</span><span class="pl-c1">String</span>} <span class="pl-k">&lt;:</span> <span class="pl-c1">Domain{T}</span>
    a<span class="pl-k">::</span><span class="pl-c1">T</span>
    b<span class="pl-k">::</span><span class="pl-c1">T</span>
<span class="pl-k">end</span></pre></div>
<p dir="auto">because it seems like that type is not able to be constructed</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; Interval(&quot;he&quot;,&quot;llo&quot;)
ERROR: type: Domain: in T, expected T&lt;:Number, got Type{ASCIIString}

julia&gt; Interval(3,4)
ERROR: `Interval{T&lt;:String}` has no method matching Interval{T&lt;:String}(::Int64, ::Int64)"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">Interval</span>(<span class="pl-s"><span class="pl-pds">"</span>he<span class="pl-pds">"</span></span>,<span class="pl-s"><span class="pl-pds">"</span>llo<span class="pl-pds">"</span></span>)
ERROR<span class="pl-k">:</span> type<span class="pl-k">:</span> Domain<span class="pl-k">:</span> <span class="pl-k">in</span> T, expected T<span class="pl-k">&lt;:</span><span class="pl-c1">Number</span>, got Type{ASCIIString}

julia<span class="pl-k">&gt;</span> <span class="pl-c1">Interval</span>(<span class="pl-c1">3</span>,<span class="pl-c1">4</span>)
ERROR<span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">`</span>Interval{T&lt;:String}<span class="pl-pds">`</span></span> has no method matching <span class="pl-c1">Interval</span><span class="pl-c1">{T&lt;:String}</span>(<span class="pl-k">::</span><span class="pl-c1">Int64</span>, <span class="pl-k">::</span><span class="pl-c1">Int64</span>)</pre></div>