Smart completion: generic functions are correctly included into the list

#KT-6375 Fixed
This commit is contained in:
Valentin Kipyatkov
2014-12-03 14:00:33 +03:00
parent a40db1e794
commit 856be73500
24 changed files with 388 additions and 126 deletions
@@ -108,6 +108,7 @@ public class ValueParameterDescriptorImpl extends VariableDescriptorImpl impleme
@NotNull
@Override
public ValueParameterDescriptor substitute(@NotNull TypeSubstitutor substitutor) {
if (substitutor.isEmpty()) return this;
throw new UnsupportedOperationException(); // TODO
}
@@ -25,6 +25,7 @@ import org.jetbrains.jet.lang.types.JetType
import org.jetbrains.jet.lang.types.Flexibility
import org.jetbrains.jet.lang.types.TypeConstructor
import org.jetbrains.jet.utils.toReadOnlyList
import org.jetbrains.jet.lang.types.checker.JetTypeChecker
fun JetType.getContainedTypeParameters(): Collection<TypeParameterDescriptor> {
val declarationDescriptor = getConstructor().getDeclarationDescriptor()
@@ -59,3 +60,6 @@ public fun JetType.getContainedAndCapturedTypeParameterConstructors(): Collectio
return typeParameters.map { it.getTypeConstructor() }.toReadOnlyList()
}
public fun JetType.isSubtypeOf(superType: JetType): Boolean = JetTypeChecker.DEFAULT.isSubtypeOf(this, superType)