[FIR] Fix constructors aliased importing

This commit is contained in:
Mikhail Glukhikh
2020-01-29 11:36:35 +03:00
parent bf9673a0a2
commit b4267558d7
3 changed files with 6 additions and 7 deletions
@@ -39,9 +39,8 @@ internal fun FirScope.processFunctionsAndConstructorsByName(
processor,
session,
bodyResolveComponents.scopeSession,
name,
noInnerConstructors
)
noInnerConstructors
)
processSyntheticConstructors(
matchedClassSymbol,
@@ -131,7 +130,6 @@ private fun processConstructors(
processor: (FirFunctionSymbol<*>) -> Unit,
session: FirSession,
scopeSession: ScopeSession,
name: Name,
noInner: Boolean
) {
try {
@@ -152,7 +150,8 @@ private fun processConstructors(
val constructorName = when (matchedSymbol) {
is FirTypeAliasSymbol -> finalExpansionName(matchedSymbol, session) ?: return
is FirClassSymbol -> name
is FirRegularClassSymbol -> matchedSymbol.fir.name
else -> return
}
//TODO: why don't we use declared member scope at this point?
@@ -12,7 +12,7 @@ import foo.A as B
fun test_1() {
val a = <!UNRESOLVED_REFERENCE!>A<!>()
val b = <!UNRESOLVED_REFERENCE!>B<!>() // should be OK
val b = B() // should be OK
val c: B = <!UNRESOLVED_REFERENCE!>A<!>()
}
@@ -11,7 +11,7 @@ FILE: A.kt
FILE: main.kt
public final fun test_1(): R|kotlin/Unit| {
lval a: <ERROR TYPE REF: Unresolved name: A> = <Unresolved name: A>#()
lval b: <ERROR TYPE REF: Unresolved name: B> = <Unresolved name: B>#()
lval b: R|foo/A| = R|foo/A.A|()
lval c: R|foo/A| = <Unresolved name: A>#()
}
public final fun test_2(b: R|foo/A|): R|kotlin/Unit| {