Allow singletons and functions with the same name

This commit is contained in:
Alexander Udalov
2013-12-02 16:12:03 +04:00
parent dcedbed7e1
commit 080bd42f88
3 changed files with 30 additions and 0 deletions
@@ -91,6 +91,10 @@ public class OverloadResolver {
MultiMap<Key, ConstructorDescriptor> inNamespaces = MultiMap.create();
for (MutableClassDescriptor klass : context.getClasses().values()) {
if (klass.getKind().isSingleton()) {
// Constructors of singletons aren't callable from the code, so they shouldn't participate in overload name checking
continue;
}
DeclarationDescriptor containingDeclaration = klass.getContainingDeclaration();
if (containingDeclaration instanceof NamespaceDescriptor) {
NamespaceDescriptor namespaceDescriptor = (NamespaceDescriptor) containingDeclaration;