Remove obsolete InlineStrategy

Replace corresponding metadata property in js.ast with Boolean. This
allows to get rid of dependency of 'js.ast' on 'frontend'.
This commit is contained in:
Alexander Udalov
2020-03-15 13:57:03 +01:00
committed by Alexander Udalov
parent 4156a9c80b
commit 8dd04789ad
12 changed files with 44 additions and 101 deletions
@@ -1,27 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.resolve.inline;
public enum InlineStrategy {
AS_FUNCTION,
IN_PLACE,
NOT_INLINE;
public boolean isInline() {
return this != NOT_INLINE;
}
}
@@ -45,7 +45,7 @@ public class InlineUtil {
}
public static boolean isInline(@Nullable DeclarationDescriptor descriptor) {
return descriptor instanceof FunctionDescriptor && getInlineStrategy((FunctionDescriptor) descriptor).isInline();
return descriptor instanceof FunctionDescriptor && ((FunctionDescriptor) descriptor).isInline();
}
public static boolean hasInlineAccessors(@NotNull PropertyDescriptor propertyDescriptor) {
@@ -74,15 +74,6 @@ public class InlineUtil {
return isInlineOrContainingInline(descriptor.getContainingDeclaration());
}
@NotNull
private static InlineStrategy getInlineStrategy(@NotNull FunctionDescriptor descriptor) {
if (descriptor.isInline()) {
return InlineStrategy.AS_FUNCTION;
}
return InlineStrategy.NOT_INLINE;
}
public static boolean checkNonLocalReturnUsage(
@NotNull DeclarationDescriptor fromFunction,
@NotNull KtExpression startExpression,