Removed explicit invoke()
This commit is contained in:
+5
-11
@@ -77,13 +77,9 @@ public abstract class AbstractLazyMemberScope<D : DeclarationDescriptor, DP : De
|
|||||||
|
|
||||||
override fun getContainingDeclaration() = thisDescriptor
|
override fun getContainingDeclaration() = thisDescriptor
|
||||||
|
|
||||||
override fun getClassifier(name: Name): ClassDescriptor? {
|
override fun getClassifier(name: Name): ClassDescriptor? = classDescriptors(name).firstOrNull()
|
||||||
return classDescriptors.invoke(name).firstOrNull()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getFunctions(name: Name): Collection<FunctionDescriptor> {
|
override fun getFunctions(name: Name): Set<FunctionDescriptor> = functionDescriptors(name)
|
||||||
return functionDescriptors.invoke(name)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun doGetFunctions(name: Name): Collection<FunctionDescriptor> {
|
private fun doGetFunctions(name: Name): Collection<FunctionDescriptor> {
|
||||||
val result = Sets.newLinkedHashSet<FunctionDescriptor>()
|
val result = Sets.newLinkedHashSet<FunctionDescriptor>()
|
||||||
@@ -110,9 +106,7 @@ public abstract class AbstractLazyMemberScope<D : DeclarationDescriptor, DP : De
|
|||||||
|
|
||||||
protected abstract fun getNonDeclaredFunctions(name: Name, result: MutableSet<FunctionDescriptor>)
|
protected abstract fun getNonDeclaredFunctions(name: Name, result: MutableSet<FunctionDescriptor>)
|
||||||
|
|
||||||
override fun getProperties(name: Name): Collection<VariableDescriptor> {
|
override fun getProperties(name: Name): Set<VariableDescriptor> = propertyDescriptors(name)
|
||||||
return propertyDescriptors.invoke(name)
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun doGetProperties(name: Name): Collection<VariableDescriptor> {
|
public fun doGetProperties(name: Name): Collection<VariableDescriptor> {
|
||||||
val result = Sets.newLinkedHashSet<VariableDescriptor>()
|
val result = Sets.newLinkedHashSet<VariableDescriptor>()
|
||||||
@@ -155,7 +149,7 @@ public abstract class AbstractLazyMemberScope<D : DeclarationDescriptor, DP : De
|
|||||||
val result = ArrayList<DeclarationDescriptor>(declarations.size())
|
val result = ArrayList<DeclarationDescriptor>(declarations.size())
|
||||||
for (declaration in declarations) {
|
for (declaration in declarations) {
|
||||||
if (declaration is JetClassOrObject) {
|
if (declaration is JetClassOrObject) {
|
||||||
result.addAll(classDescriptors.invoke(declaration.getNameAsSafeName()))
|
result.addAll(classDescriptors(declaration.getNameAsSafeName()))
|
||||||
}
|
}
|
||||||
else if (declaration is JetFunction) {
|
else if (declaration is JetFunction) {
|
||||||
result.addAll(getFunctions(declaration.getNameAsSafeName()))
|
result.addAll(getFunctions(declaration.getNameAsSafeName()))
|
||||||
@@ -167,7 +161,7 @@ public abstract class AbstractLazyMemberScope<D : DeclarationDescriptor, DP : De
|
|||||||
result.addAll(getProperties(declaration.getNameAsSafeName()))
|
result.addAll(getProperties(declaration.getNameAsSafeName()))
|
||||||
}
|
}
|
||||||
else if (declaration is JetScript) {
|
else if (declaration is JetScript) {
|
||||||
result.addAll(classDescriptors.invoke(ScriptNameUtil.classNameForScript(declaration).shortName()))
|
result.addAll(classDescriptors(ScriptNameUtil.classNameForScript(declaration).shortName()))
|
||||||
}
|
}
|
||||||
else if (declaration is JetTypedef || declaration is JetMultiDeclaration) {
|
else if (declaration is JetTypedef || declaration is JetMultiDeclaration) {
|
||||||
// Do nothing for typedefs as they are not supported.
|
// Do nothing for typedefs as they are not supported.
|
||||||
|
|||||||
+2
-2
@@ -51,11 +51,11 @@ public class LazyScriptClassMemberScope protected(
|
|||||||
super.getNonDeclaredProperties(name, result)
|
super.getNonDeclaredProperties(name, result)
|
||||||
|
|
||||||
if (name.asString() == ScriptDescriptor.LAST_EXPRESSION_VALUE_FIELD_NAME) {
|
if (name.asString() == ScriptDescriptor.LAST_EXPRESSION_VALUE_FIELD_NAME) {
|
||||||
result.add(scriptResultProperty.invoke())
|
result.add(scriptResultProperty())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun getScriptResultProperty(): PropertyDescriptor = scriptResultProperty.invoke()
|
public fun getScriptResultProperty(): PropertyDescriptor = scriptResultProperty()
|
||||||
|
|
||||||
override fun createPropertiesFromPrimaryConstructorParameters(name: Name, result: MutableSet<VariableDescriptor>) {
|
override fun createPropertiesFromPrimaryConstructorParameters(name: Name, result: MutableSet<VariableDescriptor>) {
|
||||||
val scriptInfo = declarationProvider.getOwnerInfo() as JetScriptInfo
|
val scriptInfo = declarationProvider.getOwnerInfo() as JetScriptInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user