diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt index abde7cccc51..d152c81e710 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt @@ -189,8 +189,7 @@ fun JetExpression.guessTypes( } private fun JetNamedDeclaration.guessType(context: BindingContext): Array { - val scope = getContainingFile()!!.getUseScope() - val expectedTypes = SearchUtils.findAllReferences(this, scope)!!.stream().map { ref -> + val expectedTypes = SearchUtils.findAllReferences(this, getUseScope())!!.stream().map { ref -> if (ref is JetSimpleNameReference) { context[BindingContext.EXPECTED_EXPRESSION_TYPE, ref.expression] }