FIR: provide constructors from importing scopes
This commit is contained in:
committed by
Mikhail Glukhikh
parent
e7ea75fd81
commit
3a50d2e666
+14
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.fir.symbols.CallableId
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeFunctionSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeVariableSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.cast
|
||||
@@ -53,6 +54,19 @@ abstract class FirAbstractImportingScope(session: FirSession, lookupInFir: Boole
|
||||
return ProcessorAction.STOP
|
||||
}
|
||||
} else {
|
||||
val matchedClass = provider.getClassLikeSymbolByFqName(ClassId(import.packageFqName, name))
|
||||
|
||||
if (matchedClass != null && matchedClass is FirClassSymbol) {
|
||||
//TODO: why don't we use declared member scope at this point?
|
||||
if (matchedClass.fir.buildUseSiteScope(session, scopeCache).processFunctionsByName(
|
||||
name,
|
||||
processor
|
||||
) == ProcessorAction.STOP
|
||||
) {
|
||||
return ProcessorAction.STOP
|
||||
}
|
||||
}
|
||||
|
||||
val symbols = provider.getTopLevelCallableSymbols(callableId.packageName, callableId.callableName)
|
||||
|
||||
for (symbol in symbols) {
|
||||
|
||||
@@ -7,7 +7,7 @@ FILE: Annotations.kt
|
||||
|
||||
@R|annotations/Simple|() public abstract fun foo(@R|annotations/WithString|(String(abc)) arg: @R|annotations/Simple|() R|kotlin/Double|): R|kotlin/Unit|
|
||||
|
||||
@R|annotations/Complex|(<Unresolved name: WithInt>#(Int(7)), <Unresolved name: WithString>#(String())) public abstract val v: R|kotlin/String|
|
||||
@R|annotations/Complex|(R|annotations/WithInt.WithInt|(Int(7)), R|annotations/WithString.WithString|(String())) public abstract val v: R|kotlin/String|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
FILE: treeSet.kt
|
||||
public final val x: R|java/util/SortedSet<kotlin/Int>| = <Unresolved name: TreeSet>#()
|
||||
public final val x: R|java/util/SortedSet<kotlin/Int>| = R|java/util/TreeSet.TreeSet|()
|
||||
public get(): R|java/util/SortedSet<kotlin/Int>|
|
||||
|
||||
Reference in New Issue
Block a user