No callable reference to generic callables

This commit is contained in:
Valentin Kipyatkov
2015-10-02 17:03:40 +03:00
parent feb4492455
commit cbf5be5c08
4 changed files with 14 additions and 6 deletions
@@ -238,9 +238,9 @@ private fun MutableCollection<LookupElement>.addLookupElementsForNullable(factor
}
fun CallableDescriptor.callableReferenceType(resolutionFacade: ResolutionFacade): FuzzyType? {
if (!CallType.CALLABLE_REFERENCE.descriptorKindFilter.accepts(this)) return null // not supported by callable references
val type = getReflectionTypeForCandidateDescriptor(this, resolutionFacade.getFrontendService(ReflectionTypes::class.java)) ?: return null
//TODO: no generic
return FuzzyType(type, emptyList()/* references to generic functions not supported yet */)
return FuzzyType(type, emptyList())
}
fun LookupElementFactory.createLookupElementsInSmartCompletion(
@@ -9,6 +9,9 @@ var globalVar = 1
fun funWithFunctionParameter(p: () -> Unit) {}
// callable references to generic functions are not supported currently
fun <T> genericFun(t: T): T = t
class C {
fun memberFun(){}
@@ -51,3 +54,4 @@ abstract class AbstractClass
// ABSENT: class
// ABSENT: class.java
// EXIST: { itemText: "funWithFunctionParameter", tailText: "(p: () -> Unit) (<root>)", attributes: "" }
// ABSENT: genericFun
@@ -7,4 +7,8 @@ fun bar() {
fun f(){}
fun f(i: Int){}
// currently not supported for generic funcitons
fun<T> genericF(t: T){}
// EXIST: ::f
// ABSENT: ::genericF