KT-12949 Type aliases are not considered for import when there is an unresolved reference
#KT-12949 Fixed
This commit is contained in:
@@ -197,6 +197,8 @@ internal abstract class OrdinaryImportFixBase<T : KtExpression>(expression: T) :
|
|||||||
indicesHelper.getJvmClassesByName(name).filterTo(result, filterByCallType)
|
indicesHelper.getJvmClassesByName(name).filterTo(result, filterByCallType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
indicesHelper.getTopLevelTypeAliases { it == name }.filterTo(result, filterByCallType)
|
||||||
|
|
||||||
indicesHelper.getTopLevelCallablesByName(name).filterTo(result, filterByCallType)
|
indicesHelper.getTopLevelCallablesByName(name).filterTo(result, filterByCallType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import dependency.TestAlias
|
||||||
|
|
||||||
|
// "Import" "true"
|
||||||
|
// ERROR: Unresolved reference: TestAlias
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val a = <caret>TestAlias
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package dependency
|
||||||
|
|
||||||
|
typealias TestAlias = () -> Unit
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
// "Import" "true"
|
||||||
|
// ERROR: Unresolved reference: TestAlias
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val a = <caret>TestAlias
|
||||||
|
}
|
||||||
@@ -473,6 +473,12 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes
|
|||||||
doTestWithExtraFile(fileName);
|
doTestWithExtraFile(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typeAliasImport.before.Main.kt")
|
||||||
|
public void testTypeAliasImport() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/quickfix/autoImports/typeAliasImport.before.Main.kt");
|
||||||
|
doTestWithExtraFile(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("unaryMinusOperator.before.Main.kt")
|
@TestMetadata("unaryMinusOperator.before.Main.kt")
|
||||||
public void testUnaryMinusOperator() throws Exception {
|
public void testUnaryMinusOperator() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/quickfix/autoImports/unaryMinusOperator.before.Main.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/quickfix/autoImports/unaryMinusOperator.before.Main.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user