title: Discriminated union type checking in F# with differernt return types
body: <p>I am trying to write an interpreter in F#. I want to check the type of expressions. </p>
  
  <p>Here is my discriminated union for the expressions</p>
  
  <pre><code>type Expr =
  | Integer of int
  | String of string
  | Boolean of bool
  </code></pre>
  
  <p>This is the method i am using to check the types with</p>
  
  <pre><code>let checkType (e:Expr) =
  match e with 
  | String s -&gt; s
  | Integer i -&gt; i
  | Boolean b -&gt; b
  </code></pre>
  
  <p>I want the method to determine wether an expression is a string,integer or boolean.</p>
  
  <p>However, visual studio gives me the following error on line 4 of the checkType method:</p>
  
  <pre><code> This expression was expected to have type string but here has type int
  </code></pre>
  
  <p>Am i missing something?</p>