title: How to test a value on being AnyVal?
body: <p>Tried this:</p>
  
  <pre><code>scala&gt; 2.isInstanceOf[AnyVal]
  &lt;console&gt;:8: error: type AnyVal cannot be used in a type pattern or isInstanceOf test
                2.isInstanceOf[AnyVal]
                              ^
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>scala&gt; 12312 match {
       | case _: AnyVal =&gt; true
       | case _ =&gt; false
       | }
  &lt;console&gt;:9: error: type AnyVal cannot be used in a type pattern or isInstanceOf test
                case _: AnyVal =&gt; true
                        ^
  </code></pre>
  
  <p>The message is very informative. I get that I can't use it, but what should I do?</p>