Skip to content

Commit

Permalink
[KT] Use JetBrains-provided extension function isAnnotationClass in…
Browse files Browse the repository at this point in the history
… Kotlin environment instead of redefining our own function.

PiperOrigin-RevId: 721397550
  • Loading branch information
jDramaix authored and copybara-github committed Jan 30, 2025
1 parent f693b38 commit 378f88b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import com.google.j2cl.transpiler.frontend.kotlin.ir.isJsOptional
import com.google.j2cl.transpiler.frontend.kotlin.ir.isJsType
import com.google.j2cl.transpiler.frontend.kotlin.ir.isNativeJsField
import com.google.j2cl.transpiler.frontend.kotlin.ir.isUncheckedCast
import com.google.j2cl.transpiler.frontend.kotlin.ir.j2clIsAnnotation
import com.google.j2cl.transpiler.frontend.kotlin.ir.j2clKind
import com.google.j2cl.transpiler.frontend.kotlin.ir.j2clVisibility
import com.google.j2cl.transpiler.frontend.kotlin.ir.javaName
Expand Down Expand Up @@ -109,6 +108,7 @@ import org.jetbrains.kotlin.ir.util.defaultType
import org.jetbrains.kotlin.ir.util.dump
import org.jetbrains.kotlin.ir.util.file
import org.jetbrains.kotlin.ir.util.hasAnnotation
import org.jetbrains.kotlin.ir.util.isAnnotationClass
import org.jetbrains.kotlin.ir.util.isAnonymousObject
import org.jetbrains.kotlin.ir.util.isFakeOverride
import org.jetbrains.kotlin.ir.util.isFromJava
Expand Down Expand Up @@ -203,7 +203,7 @@ class KotlinEnvironment(
TypeDeclaration.newBuilder()
.setClassComponents(irClass.getClassComponents())
.setKind(irClass.j2clKind)
.setAnnotation(irClass.j2clIsAnnotation)
.setAnnotation(irClass.isAnnotationClass)
.setSourceLanguage(if (irClass.isFromJava()) JAVA else KOTLIN)
.setOriginalSimpleSourceName(irClass.simpleSourceName)
.setPackage(createPackageDeclaration(irClass.packageFqName!!.asString()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ val IrClass.j2clKind: Kind
ClassKind.ENUM_CLASS -> Kind.ENUM
}

val IrClass.j2clIsAnnotation: Boolean
get() = kind == ClassKind.ANNOTATION_CLASS

val IrDeclarationWithVisibility.j2clVisibility: Visibility
get() =
when (visibility.delegate) {
Expand Down

0 comments on commit 378f88b

Please sign in to comment.