fix incorrect overload error in different namespaces with same suffix
===
namespace a {
fun f() = 1
}
namespace b {
namespace a {
fun f() = 1
}
}
===
This commit is contained in:
@@ -8,6 +8,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import org.jetbrains.jet.lang.descriptors.*;
|
import org.jetbrains.jet.lang.descriptors.*;
|
||||||
import org.jetbrains.jet.lang.diagnostics.Errors;
|
import org.jetbrains.jet.lang.diagnostics.Errors;
|
||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
|
import org.jetbrains.jet.resolve.DescriptorRenderer;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -61,7 +62,7 @@ public class OverloadResolver {
|
|||||||
DeclarationDescriptor containingDeclaration = function.getContainingDeclaration();
|
DeclarationDescriptor containingDeclaration = function.getContainingDeclaration();
|
||||||
if (containingDeclaration instanceof NamespaceDescriptor) {
|
if (containingDeclaration instanceof NamespaceDescriptor) {
|
||||||
NamespaceDescriptor namespaceDescriptor = (NamespaceDescriptor) containingDeclaration;
|
NamespaceDescriptor namespaceDescriptor = (NamespaceDescriptor) containingDeclaration;
|
||||||
functionsByName.putValue(new Key(namespaceDescriptor.getName(), function.getName()), function);
|
functionsByName.putValue(new Key(DescriptorRenderer.getFQName(namespaceDescriptor), function.getName()), function);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,3 +40,9 @@ namespace ns2 {
|
|||||||
fun e() = 1
|
fun e() = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace ns3 {
|
||||||
|
namespace ns1 {
|
||||||
|
fun e() = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user