Corrected implementation of DeclarationDescriptor.canBeReferencedViaImport() to include object members
This commit is contained in:
@@ -47,7 +47,7 @@ public fun DeclarationDescriptor.canBeReferencedViaImport(): Boolean {
|
||||
return when (this) {
|
||||
is ConstructorDescriptor -> !parentClass.isInner() // inner class constructors can't be referenced via import
|
||||
is ClassDescriptor -> true
|
||||
else -> false
|
||||
else -> parentClass.kind == ClassKind.OBJECT
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// ERROR: Unresolved reference: f
|
||||
package to
|
||||
|
||||
import a.A
|
||||
|
||||
fun g() {
|
||||
f()
|
||||
A.f()
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
a.A.Companion.f
|
||||
Reference in New Issue
Block a user