Overriding generic function error in swift
<p>Here's the code:</p>

<pre><code>class Test&lt;T&gt; { 
    func foo&lt;S:SequenceType where S.Generator.Element == T&gt;(par : S){
        print("foo")
    }
}
class TestInh : Test&lt;Int&gt; { 
    override func foo&lt;S:SequenceType where S.Generator.Element == Int&gt;(par : S) { 
        print("loo")
    } 
}
</code></pre>

<p>And it yells such error:</p>

<pre><code>repl.swift:8:19: error: method does not override any method from its superclass
    override func foo&lt;S:SequenceType where S.Generator.Element == Int&gt;(par : S) {
    ~~~~~~~~      ^
</code></pre>

<p>How could I override the method in super class <code>Test&lt;Int&gt;</code>?</p>

<p>==================additional=======================</p>

<p>When it comes to the code blow.</p>

<pre><code>class Test&lt;T&gt; { 
    func foo(par : T){
        print("foo")
    }
}
class TestInh : Test&lt;Int&gt; { 
    override func foo(par : Int) { 
        print("loo")
    } 
}
</code></pre>

<p>Everything works fine. Not knowing what happened on <code>where</code> statement's appearing.</p>