Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

204
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda