Semantic highlighting: some type ascriptions on trait members not rendered
Example code (one simple scenario of many):
Type ascriptions on firstName and lastName are not rendered with highlight-color. See attached sample. (Color scheme exaggarated for clarity...)
trait Address
trait Person {
val firstName: String
val lastName: Option[String]
val address: Address
val greeting: String = "hello"
}
case class OtherPerson(firstName: String, lastName: Option[String], address: Address)
Type ascriptions on firstName and lastName are not rendered with highlight-color. See attached sample. (Color scheme exaggarated for clarity...)
Leave a comment
The rendering is correct. `String` is a type alias in Predef (hyperlinking will show the definition). There are different colors for types and classes, and that's what you see.
It's definitely not correct. For this example, types are set to light green, which is what you see elsewhere for String in the image above.
Just to be very specific, in this example (not necessarily in general):
1) String, which is a type, is rendered without highlighting when used as type ascription on an abstract val, but correctly when used on an initialized val and on a case class constuctor parameter. The same applies for String when used for type parameterization.
2) Option, which is a class, is rendered without highlighting when used as type ascription on an abstract val, but correctly on a case class constructor parameter.
Note also that the bug is not limited to these examples, I could easily mock up more variations of it if you'd like.
Just to be very specific, in this example (not necessarily in general):
1) String, which is a type, is rendered without highlighting when used as type ascription on an abstract val, but correctly when used on an initialized val and on a case class constuctor parameter. The same applies for String when used for type parameterization.
2) Option, which is a class, is rendered without highlighting when used as type ascription on an abstract val, but correctly on a case class constructor parameter.
Note also that the bug is not limited to these examples, I could easily mock up more variations of it if you'd like.
Thanks for the explanations, you are right.
on 2012-06-07 07:52 *
By Iulian Dragos
The presentation compiler is at fault. The type ascriptions that are not highlighted are not hyperlink-able either. It happens with any abstract val / abstract type combination.
on 2012-06-07 11:04 *
By Mirko Stocker
It also doesn't work completely with mark occurrences (String works, but Option doesn't); it would be really good to have more information on types in the AST.
on 2012-08-05 17:10 *
By Simon Schäfer
Version changed from 2.1.0-nightly-29 to 2.1.0-nightly-210
Eclipse version changed from Indigo to Indigo - Eclipse 3.7
Assigned to set to Simon Schäfer
on 2012-08-07 15:20 *
By Simon Schäfer
Did someone already submit a bug report to the presentation compiler?
on 2015-03-16 04:28 *
By Simon Schäfer
Version changed from 2.1.0-nightly-210 to 4.0.0
Status changed from New to Accepted