title: How can I determine the type of a variable when it is not given?
body: <p>Assume, we have something like:</p>
  
  <pre><code>val x = "foo".charAt(0)
  </code></pre>
  
  <p>and let us further assume, we do not know the return type of the method <code>charAt(0)</code> (which is, of course, described in the Scala API). Is there a way, we can find out, which type the variable <code>x</code> has after its definition and when it is not declared explicitly?</p>
  
  <p><strong>UPDATE 1:</strong>
  My initial question was not precise enough: I would like to know (for debugging reasons) what type the variable has. Maybe there is some compiler option to see what type the variable get declared to by Scala's type inference ?</p>