Fix exception on attempt to map inner non-fixed type variable

#KT-31842 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2019-06-06 17:24:11 +03:00
parent e542c9ea84
commit 42b7552d17
4 changed files with 32 additions and 1 deletions
@@ -0,0 +1,6 @@
class Some<T : Some<T>>
fun test(list: List<Any>) {
list.filterIsInstance<Some>().mapTo(mutableSetOf()) {
}
}
@@ -0,0 +1,22 @@
UFile (package = ) [public final class InnerNonFixedTypeVariableKt {...]
UClass (name = InnerNonFixedTypeVariableKt) [public final class InnerNonFixedTypeVariableKt {...}]
UAnnotationMethod (name = test) [public static final fun test(@org.jetbrains.annotations.NotNull list: java.util.List<? extends java.lang.Object>) : void {...}]
UParameter (name = list) [@org.jetbrains.annotations.NotNull var list: java.util.List<? extends java.lang.Object>]
UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull]
UBlockExpression [{...}] : PsiType:<ErrorType>
UQualifiedReferenceExpression [list.filterIsInstance().<ERROR FUNCTION>(mutableSetOf(), { ...})] : PsiType:<ErrorType>
UQualifiedReferenceExpression [list.filterIsInstance()]
USimpleNameReferenceExpression (identifier = list) [list] : PsiType:List<? extends Object>
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [filterIsInstance()]
UIdentifier (Identifier (filterIsInstance)) [UIdentifier (Identifier (filterIsInstance))]
USimpleNameReferenceExpression (identifier = filterIsInstance, resolvesTo = null) [filterIsInstance]
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 2)) [<ERROR FUNCTION>(mutableSetOf(), { ...})] : PsiType:<ErrorType>
UIdentifier (Identifier (mapTo)) [UIdentifier (Identifier (mapTo))]
USimpleNameReferenceExpression (identifier = <ERROR FUNCTION>, resolvesTo = null) [<ERROR FUNCTION>] : PsiType:<ErrorType>
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [mutableSetOf()] : PsiType:<ErrorType>
UIdentifier (Identifier (mutableSetOf)) [UIdentifier (Identifier (mutableSetOf))]
USimpleNameReferenceExpression (identifier = mutableSetOf, resolvesTo = null) [mutableSetOf] : PsiType:<ErrorType>
ULambdaExpression [{ ...}] : PsiType:Function0<? extends Unit>
UBlockExpression [{...}]
UClass (name = Some) [public final class Some {...}]
UAnnotationMethod (name = Some) [public fun Some() = UastEmptyExpression]