title: assign null default value for optional query param in route - Play Framework
body: <p>I'm trying to define an optional query parameter that will map to a <code>Long</code>, but will be <code>null</code> when it is not present in the URL:</p>
  
  <pre><code>GET  /foo  controller.Foo.index(id: Long ?= null)
  </code></pre>
  
  <p>... and I essentially want to check if it was passed in or not:</p>
  
  <pre><code>public static Result index(Long id) {
      if (id == null) {...}
      ...
  }
  </code></pre>
  
  <p>However, I'm getting a compilation error:</p>
  
  <blockquote>
    <p>type mismatch; found : Null(null) required: Long Note that implicit
    conversions are not applicable because they are ambiguous: both method
    Long2longNullConflict in class LowPriorityImplicits of type (x:
    Null)Long and method Long2long in object Predef of type (x: Long)Long
    are possible conversion functions from Null(null) to Long</p>
  </blockquote>
  
  <p>Why can't I do this, assigning <code>null</code> to be a default value for an expected <code>Long</code> optional query parameter? What's an alternative way to do this?</p>