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

301
Vistas
How can I specify a generic type parameter in a Kotlin @Deprecated annotation?

I want to rename a Kotlin type, leaving a deprecated typealias to allow existing code to compile.

typealias TestContext<F> = ContextBuilder<F>

@Deprecated("TestContext is now ContextBuilder", 
    replaceWith = ReplaceWith("ContextBuilder<F>"))

leads to TextContext<Unit> being replaced with ContextBuilder<F>

@Deprecated("TestContext is now ContextBuilder", 
    replaceWith = ReplaceWith("ContextBuilder"))

leads to TextContext<Unit> being replaced with ContextBuilder

How can I write the replaceWith expression so that IntelliJ replaces TextContext<Unit> with ContextBuilder<Unit>?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

This is possible now! The ReplaceWith intention saves generic type arguments from Kotlin plugin v1.3.40 on (see change log).

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