diff --git a/idea/src/org/jetbrains/jet/plugin/completion/SmartCompletion.kt b/idea/src/org/jetbrains/jet/plugin/completion/SmartCompletion.kt index a3533a3648c..60817a11fc2 100644 --- a/idea/src/org/jetbrains/jet/plugin/completion/SmartCompletion.kt +++ b/idea/src/org/jetbrains/jet/plugin/completion/SmartCompletion.kt @@ -14,6 +14,7 @@ import org.jetbrains.jet.plugin.completion.handlers.* import com.google.common.collect.SetMultimap import java.util.* import org.jetbrains.jet.lang.resolve.calls.autocasts.* +import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns trait SmartCompletionData{ fun accepts(descriptor: DeclarationDescriptor): Boolean @@ -51,6 +52,9 @@ fun buildSmartCompletionData(expression: JetSimpleNameExpression, resolveSession fun typesOf(descriptor: DeclarationDescriptor): Iterable { if (descriptor is CallableDescriptor) { var returnType = descriptor.getReturnType() + if (returnType != null && KotlinBuiltIns.getInstance().isNothing(returnType!!)) { //TODO: maybe we should include them on the second press? + return listOf() + } if (descriptor is VariableDescriptor) { if (notNullVariables.contains(descriptor) && returnType != null) { returnType = TypeUtils.makeNotNullable(returnType!!) diff --git a/idea/testData/completion/smart/NoNothing.kt.todo b/idea/testData/completion/smart/NoNothing.kt similarity index 100% rename from idea/testData/completion/smart/NoNothing.kt.todo rename to idea/testData/completion/smart/NoNothing.kt diff --git a/idea/tests/org/jetbrains/jet/completion/JetSmartCompletionTestGenerated.java b/idea/tests/org/jetbrains/jet/completion/JetSmartCompletionTestGenerated.java index 59385506720..440fb6d69a5 100644 --- a/idea/tests/org/jetbrains/jet/completion/JetSmartCompletionTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/completion/JetSmartCompletionTestGenerated.java @@ -111,6 +111,11 @@ public class JetSmartCompletionTestGenerated extends AbstractJvmSmartCompletionT doTest("idea/testData/completion/smart/NoConstructorWithQualifier.kt"); } + @TestMetadata("NoNothing.kt") + public void testNoNothing() throws Exception { + doTest("idea/testData/completion/smart/NoNothing.kt"); + } + @TestMetadata("NoSillyAssignment.kt") public void testNoSillyAssignment() throws Exception { doTest("idea/testData/completion/smart/NoSillyAssignment.kt");