title: Is actually possible to deprecate Scala case class fields?
body: <p>Given</p>
  
  <pre><code>case class Fruit(name: String, colour: String)
  </code></pre>
  
  <p>I'd like to deprecate the case class field <code>colour</code>.</p>
  
  <p>I tried to achieve the former by both employing Scala <code>@deprecated</code></p>
  
  <pre><code>case class Fruit(name: String, @deprecated("message", "since") colour: String)
  </code></pre>
  
  <p>and Java <code>@Deprecated</code> annotation</p>
  
  <pre><code>case class Fruit(
    name: String, 
    /* @Deprecated with some message here */
    @(Deprecated @field) 
    colour: String
  )
  </code></pre>
  
  <p>Unfortunately I wasn't able to make <code>colour</code> deprecated in any case and I'm not able to find any resource on that.</p>
  
  <p>Indeed, I can achieve the same task using other approaches, e.g. by relaxing my case class to a normal class and provide a <code>getter</code> for <code>colour</code> and make the latter deprecated, but I would like to know if deprecating case class fields is actually not possible and -- eventually -- the reason why.</p>
  
  <p>Thank you.</p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <p>As Mike rightly pointed out, <code>colour</code> is a required field for a case class, so the sense of setting this attribute to <code>deprecated</code> is arguable. I'd like to deprecate <code>colour</code> , since I'm now providing <code>colour</code> information from another construct, I want to keep the user knowing that <code>colour</code> is not the right instance by where fetch that information, and I will remove it from <code>Fruit</code> in next releases.</p>
  
  <p>By now, I'd just like warn users to not fetch <code>colour</code> information from the Fruit attribute and, temporarily, I don't really care if they can create instances of fruit with colour information.</p>
  
  <hr>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>As Alexey said, I do have the deprecated warning at compile time. But why can't I observe the deprecation in my IDE code as well as I'd deprecating a method, then? I'd expect something like the following</p>
  
  <pre><code>val fruit = Fruit("peer", "green")<br>val colour = fruit.<strike>colour</strike></code></pre>
  
  <p>I'm using IntelliJ.</p>