isNamedFun decommissioned and replace by isLocalFun
This commit is contained in:
-3
@@ -410,9 +410,6 @@
|
|||||||
<inspection_tool class="UtilityClassWithPublicConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
|
<inspection_tool class="UtilityClassWithPublicConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
<inspection_tool class="UtilityClassWithoutPrivateConstructor" enabled="true" level="WARNING" enabled_by_default="true">
|
<inspection_tool class="UtilityClassWithoutPrivateConstructor" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
<option name="ignoreClassesWithOnlyMain" value="false" />
|
<option name="ignoreClassesWithOnlyMain" value="false" />
|
||||||
<option name="ignorableAnnotations">
|
|
||||||
<value />
|
|
||||||
</option>
|
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
<inspection_tool class="VolatileLongOrDoubleField" enabled="true" level="WARNING" enabled_by_default="true" />
|
<inspection_tool class="VolatileLongOrDoubleField" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
<inspection_tool class="WaitNotInLoop" enabled="true" level="WARNING" enabled_by_default="true" />
|
<inspection_tool class="WaitNotInLoop" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
|||||||
@@ -276,8 +276,7 @@ public class ClosureCodegen {
|
|||||||
: typeMapper.mapType(((VariableDescriptor) descriptor).getType(), MapTypeMode.VALUE);
|
: typeMapper.mapType(((VariableDescriptor) descriptor).getType(), MapTypeMode.VALUE);
|
||||||
args.add(new Pair<String, Type>("$" + descriptor.getName().getName(), type));
|
args.add(new Pair<String, Type>("$" + descriptor.getName().getName(), type));
|
||||||
}
|
}
|
||||||
else if (isNamedFun(state.getBindingContext(), descriptor) &&
|
else if (isLocalNamedFun(state.getBindingContext(), descriptor)) {
|
||||||
descriptor.getContainingDeclaration() instanceof FunctionDescriptor) {
|
|
||||||
final Type type =
|
final Type type =
|
||||||
classNameForAnonymousClass(bindingContext,
|
classNameForAnonymousClass(bindingContext,
|
||||||
(JetElement) BindingContextUtils.descriptorToDeclaration(bindingContext, descriptor))
|
(JetElement) BindingContextUtils.descriptorToDeclaration(bindingContext, descriptor))
|
||||||
|
|||||||
@@ -233,10 +233,11 @@ public class CodegenBinding {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isNamedFun(BindingContext bindingContext, DeclarationDescriptor fd) {
|
public static boolean isLocalNamedFun(BindingContext bindingContext, DeclarationDescriptor fd) {
|
||||||
PsiElement psiElement = BindingContextUtils.descriptorToDeclaration(bindingContext, fd);
|
PsiElement psiElement = BindingContextUtils.descriptorToDeclaration(bindingContext, fd);
|
||||||
if (psiElement instanceof JetNamedFunction) {
|
if (psiElement instanceof JetNamedFunction) {
|
||||||
return true;
|
final DeclarationDescriptor declaration = fd.getContainingDeclaration();
|
||||||
|
return declaration instanceof FunctionDescriptor || declaration instanceof PropertyDescriptor;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public interface LocalLookup {
|
|||||||
LOCAL_NAMED_FUNCTION {
|
LOCAL_NAMED_FUNCTION {
|
||||||
@Override
|
@Override
|
||||||
public boolean isCase(DeclarationDescriptor d, GenerationState state) {
|
public boolean isCase(DeclarationDescriptor d, GenerationState state) {
|
||||||
return isNamedFun(state.getBindingContext(), d) && (d.getContainingDeclaration() instanceof FunctionDescriptor);
|
return isLocalNamedFun(state.getBindingContext(), d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user