title: Defining a scala Map of functions with variable return types
body: <p>Is it possible to generalize the return types of a Map of functions with variable return types to a common signature and then use the actual return type of each function in the Map at runtime?</p>
  
  <p>Explanation:</p>
  
  <p>I'm having a scala Map of string -> functions defined as:</p>
  
  <pre><code>Map[String, (String) =&gt; Seq[Any]] = Map("1" -&gt; foo, 2 -&gt; bar, 3 -&gt; baz)
  </code></pre>
  
  <p>where foo, bar and baz are defined as:</p>
  
  <pre><code>foo(string: String): Seq[A]
  bar(string: String): Seq[B]
  baz(string: String): Seq[C]
  </code></pre>
  
  <p>The compilation works fine but at runtime Seq[A or B or C] types returned by the functions are being treated as Seq[Any] thereby giving me a reflection exception. </p>