Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
Why is smart cast so prominently highlighted?

I try to understand why smart casts are so prominently highlighted in IntelliJ. For example this String? gets smart casted to String and it draws a lot of attention: smart cast example

I'm not looking for an explanation of the smart cast feature in general, but rather try understand why Jetbrains thinks this needs developer attention.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Not JetBrains, but... Because the type change due to a smart cast is a very non-obvious thing that happens in your code, and there's no real way that you yourself could explicitly make it more visible. So the syntax highlighting does it for you.

over 4 years ago · Santiago Trujillo Report

0

I can't say from JetBrains perspective, but my opinion is because you have declared that variable first as String? for example, now one would have expected that it keeps it type but instead type is changed to String using smart cast, in this case its simple, but sometimes you might have bigger hierarchy of sealed classes for example, where different classes have different methods and this should help you remembering that type isn't same as declared, this is maybe their way to say it used to be X type, but now it is Y inside this context.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!