Workaround for compiler's bug

This commit is contained in:
Valentin Kipyatkov
2014-10-27 14:47:31 +03:00
parent 62215664ab
commit c26c8f0a84
@@ -77,9 +77,13 @@ public abstract class AbstractLazyMemberScope<D : DeclarationDescriptor, DP : De
override fun getContainingDeclaration() = thisDescriptor
override fun getClassifier(name: Name) = classDescriptors(name).firstOrNull()
override fun getClassifier(name: Name): ClassDescriptor? {
return classDescriptors.invoke(name).firstOrNull()
}
override fun getFunctions(name: Name) = functionDescriptors(name)
override fun getFunctions(name: Name): Collection<FunctionDescriptor> {
return functionDescriptors.invoke(name)
}
private fun doGetFunctions(name: Name): Collection<FunctionDescriptor> {
val result = Sets.newLinkedHashSet<FunctionDescriptor>()
@@ -106,7 +110,9 @@ public abstract class AbstractLazyMemberScope<D : DeclarationDescriptor, DP : De
protected abstract fun getNonDeclaredFunctions(name: Name, result: MutableSet<FunctionDescriptor>)
override fun getProperties(name: Name) = propertyDescriptors(name)
override fun getProperties(name: Name): Collection<VariableDescriptor> {
return propertyDescriptors.invoke(name)
}
public fun doGetProperties(name: Name): Collection<VariableDescriptor> {
val result = Sets.newLinkedHashSet<VariableDescriptor>()
@@ -160,7 +166,7 @@ public abstract class AbstractLazyMemberScope<D : DeclarationDescriptor, DP : De
result.addAll(getProperties(declaration.getNameAsSafeName()))
}
else if (declaration is JetScript) {
result.addAll(classDescriptors(ScriptNameUtil.classNameForScript(declaration).shortName()))
result.addAll(classDescriptors.invoke(ScriptNameUtil.classNameForScript(declaration).shortName()))
}
else if (declaration is JetTypedef || declaration is JetMultiDeclaration) {
// Do nothing for typedefs as they are not supported.