From af460c04df195c2d8e1f85ffce26b7a2799590db Mon Sep 17 00:00:00 2001 From: MarcoSignoretto Date: Wed, 26 Jul 2023 09:55:08 +0200 Subject: [PATCH] Erase type if kustom generic is specified --- .../kustomexport/compiler/js/mapping/TypeMapping.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/src/main/kotlin/deezer/kustomexport/compiler/js/mapping/TypeMapping.kt b/compiler/src/main/kotlin/deezer/kustomexport/compiler/js/mapping/TypeMapping.kt index 9b17a4f..7bca22b 100644 --- a/compiler/src/main/kotlin/deezer/kustomexport/compiler/js/mapping/TypeMapping.kt +++ b/compiler/src/main/kotlin/deezer/kustomexport/compiler/js/mapping/TypeMapping.kt @@ -45,9 +45,13 @@ class OriginTypeName( fun importedMethod(name: FormatString) = importMethod(name) val exportedTypeName: TypeName by lazy { - // Remove TypeParameter: because we can't export generic in a cool manner yet, so we produce concrete from generics. - // See @KustomExportGenerics - exportedType() + var type = exportedType() + if(isKustomExportAnnotated) { + // Remove TypeParameter: because we can't export generic in a cool manner yet, so we produce concrete from generics. + // See @KustomExportGenerics + type = type.removeTypeParameter() + } + type } fun exportedMethod(name: FormatString) = exportMethod(name)