diff --git a/plugins/uast-common/src/org/jetbrains/uast/expressions/UClassLiteralExpression.kt b/plugins/uast-common/src/org/jetbrains/uast/expressions/UClassLiteralExpression.kt index fc8f32e0957..03080a92060 100644 --- a/plugins/uast-common/src/org/jetbrains/uast/expressions/UClassLiteralExpression.kt +++ b/plugins/uast-common/src/org/jetbrains/uast/expressions/UClassLiteralExpression.kt @@ -18,4 +18,6 @@ package org.jetbrains.uast interface UClassLiteralExpression : UExpression, NoTraverse { override fun logString() = "UClassLiteralExpression" override fun renderString() = getExpressionType()?.name ?: "::class" + + val type: UType } \ No newline at end of file diff --git a/plugins/uast-java/src/org/jetbrains/uast/java/expressions/JavaUClassLiteralExpression.kt b/plugins/uast-java/src/org/jetbrains/uast/java/expressions/JavaUClassLiteralExpression.kt index 83013a2c4d9..e3151dc3c9e 100644 --- a/plugins/uast-java/src/org/jetbrains/uast/java/expressions/JavaUClassLiteralExpression.kt +++ b/plugins/uast-java/src/org/jetbrains/uast/java/expressions/JavaUClassLiteralExpression.kt @@ -19,9 +19,12 @@ import com.intellij.psi.PsiClassObjectAccessExpression import org.jetbrains.uast.NoEvaluate import org.jetbrains.uast.UClassLiteralExpression import org.jetbrains.uast.UElement +import org.jetbrains.uast.UType import org.jetbrains.uast.psi.PsiElementBacked class JavaUClassLiteralExpression( override val psi: PsiClassObjectAccessExpression, override val parent: UElement -) : JavaAbstractUElement(), UClassLiteralExpression, PsiElementBacked, JavaTypeHelper, NoEvaluate \ No newline at end of file +) : JavaAbstractUElement(), UClassLiteralExpression, PsiElementBacked, JavaTypeHelper, NoEvaluate { + override val type: UType by lz { JavaConverter.convert(psi.type, this) } +} \ No newline at end of file diff --git a/plugins/uast-kotlin/src/org/jetbrains/kotlin/uast/KotlinUastLanguagePlugin.kt b/plugins/uast-kotlin/src/org/jetbrains/kotlin/uast/KotlinUastLanguagePlugin.kt index 494f11c6c16..e44fb4a2a0f 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/kotlin/uast/KotlinUastLanguagePlugin.kt +++ b/plugins/uast-kotlin/src/org/jetbrains/kotlin/uast/KotlinUastLanguagePlugin.kt @@ -128,6 +128,7 @@ internal object KotlinConverter : UastConverter { } declarations = listOf(tempAssignment) + destructuringAssignments } + is KtClassLiteralExpression -> KotlinUClassLiteralExpression(expression, parent) is KtObjectLiteralExpression -> KotlinUObjectLiteralExpression(expression, parent) is KtStringTemplateEntry -> convertOrEmpty(expression.expression, parent) is KtDotQualifiedExpression -> KotlinUQualifiedExpression(expression, parent) diff --git a/plugins/uast-kotlin/src/org/jetbrains/kotlin/uast/expressions/KotlinUClassLiteralExpression.kt b/plugins/uast-kotlin/src/org/jetbrains/kotlin/uast/expressions/KotlinUClassLiteralExpression.kt new file mode 100644 index 00000000000..08e4e0a7e40 --- /dev/null +++ b/plugins/uast-kotlin/src/org/jetbrains/kotlin/uast/expressions/KotlinUClassLiteralExpression.kt @@ -0,0 +1,30 @@ +/* + * Copyright 2010-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.uast + +import org.jetbrains.kotlin.psi.KtClassLiteralExpression +import org.jetbrains.uast.NoEvaluate +import org.jetbrains.uast.UClassLiteralExpression +import org.jetbrains.uast.UElement +import org.jetbrains.uast.psi.PsiElementBacked + +class KotlinUClassLiteralExpression( + override val psi: KtClassLiteralExpression, + override val parent: UElement +) : KotlinAbstractUElement(), UClassLiteralExpression, PsiElementBacked, KotlinTypeHelper, NoEvaluate { + override val type by lz { KotlinConverter.convert(psi.typeReference, this) } +} \ No newline at end of file