Fixed an issue with Any? type declarations
This commit is contained in:
committed by
Pavel V. Talanov
parent
d03e1f5fcb
commit
f68fe0bc38
@@ -8,6 +8,7 @@ import org.jetbrains.jet.j2k.ast.*
|
||||
import org.jetbrains.jet.j2k.ast.types.*
|
||||
import java.util.LinkedList
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import java.util.ArrayList
|
||||
|
||||
public open class TypeVisitor(private val myConverter : Converter) : PsiTypeVisitor<Type>() {
|
||||
private var myResult : Type = EmptyType()
|
||||
@@ -42,7 +43,19 @@ public open class TypeVisitor(private val myConverter : Converter) : PsiTypeVisi
|
||||
val identifier : Identifier = constructClassTypeIdentifier(classType)
|
||||
val resolvedClassTypeParams : List<Type> = createRawTypesForResolvedReference(classType)
|
||||
if (classType.getParameterCount() == 0 && resolvedClassTypeParams.size() > 0) {
|
||||
myResult = ClassType(identifier, resolvedClassTypeParams, true)
|
||||
val myParamList : ArrayList<Type> = ArrayList<Type>()
|
||||
if (resolvedClassTypeParams.size() == 1) {
|
||||
if ((resolvedClassTypeParams.get(0) as ClassType).`type`.name == "Any") {
|
||||
myParamList.add(StarProjectionType())
|
||||
myResult = ClassType(identifier, myParamList, true)
|
||||
}
|
||||
else {
|
||||
myResult = ClassType(identifier, resolvedClassTypeParams, true)
|
||||
}
|
||||
}
|
||||
else {
|
||||
myResult = ClassType(identifier, resolvedClassTypeParams, true)
|
||||
}
|
||||
}
|
||||
else {
|
||||
myResult = ClassType(identifier, myConverter.typesToTypeList(classType.getParameters()), true)
|
||||
|
||||
Reference in New Issue
Block a user