Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

200
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda