title: Loop through list to call different functions
body: <p>I have a list of integer, need to loop through the list and call different functions which all have the same input parameters, here is my code: </p>
  
  <pre><code>  def callRandomFunctions(config: config, prefix: String): ChainBuilder = {
      val randomList = Random.shuffle(List(1, 2, 3, 4))
      randomList.foreach { _ =&gt;
        _ match {
          case 1 =&gt; func1(config, prefix)
          case 2 =&gt; func2(config, prefix)
          case 3 =&gt; func3(config, prefix)
          case 4 =&gt; func4(config, prefix)
        }
      }
    }
  
   def func1(config: config, prefix: String): ChainBuilder = {...}
   def func2(config: config, prefix: String): ChainBuilder = {...}
   def func3(config: config, prefix: String): ChainBuilder = {...}
   def func4(config: config, prefix: String): ChainBuilder = {...} 
  </code></pre>
  
  <p>and got these errors:</p>
  
  <pre><code>missing parameter type for expanded function
  [error] The argument types of an anonymous function must be fully known. (SLS 8.5)
  [error] Expected type was: ?
  [error]         _ match {
  [error]         ^
  
  
  [error] type mismatch;
  [error]  found   : Unit
  [error]  required: io.gatling.core.structure.ChainBuilder
  [error]     randomList.foreach {
  [error]                        ^
  [error] two errors found
  </code></pre>