Deprecated 'INSTANCE$' replaced with 'INSTANCE'

This commit is contained in:
Michael Bogdanov
2015-12-24 10:36:13 +03:00
parent 80fd9e3cbb
commit aeb6486473
98 changed files with 187 additions and 187 deletions
@@ -265,7 +265,7 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
} }
} }
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -480,7 +480,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
markLineNumber(expression, isStatement); markLineNumber(expression, isStatement);
v.mark(end); v.mark(end);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -1294,7 +1294,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
} }
} }
v.invokevirtual("java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false); v.invokevirtual("java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -1433,7 +1433,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
JvmMethodSignature constructor = typeMapper.mapSignature(SamCodegenUtil.resolveSamAdapter(constructorDescriptor)); JvmMethodSignature constructor = typeMapper.mapSignature(SamCodegenUtil.resolveSamAdapter(constructorDescriptor));
v.invokespecial(type.getInternalName(), "<init>", constructor.getAsmMethod().getDescriptor(), false); v.invokespecial(type.getInternalName(), "<init>", constructor.getAsmMethod().getDescriptor(), false);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -1551,7 +1551,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
for (Function<StackValue, Void> task : Lists.reverse(leaveTasks)) { for (Function<StackValue, Void> task : Lists.reverse(leaveTasks)) {
task.fun(value); task.fun(value);
} }
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -2789,7 +2789,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
putJavaLangClassInstance(v, classAsmType); putJavaLangClassInstance(v, classAsmType);
wrapJavaClassIntoKClass(v); wrapJavaClassIntoKClass(v);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -3248,7 +3248,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
} }
value.store(StackValue.onStack(storeType), v, true); value.store(StackValue.onStack(storeType), v, true);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -3373,7 +3373,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
CallableMethod method = typeMapper.mapToCallableMethod(constructor, false); CallableMethod method = typeMapper.mapToCallableMethod(constructor, false);
invokeMethodWithArguments(method, resolvedCall, StackValue.none()); invokeMethodWithArguments(method, resolvedCall, StackValue.none());
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -3389,7 +3389,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
public Unit invoke(InstructionAdapter v) { public Unit invoke(InstructionAdapter v) {
gen(sizeExpression, Type.INT_TYPE); gen(sizeExpression, Type.INT_TYPE);
newArrayInstruction(arrayType); newArrayInstruction(arrayType);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -3628,7 +3628,7 @@ The "returned" value of try expression with no finally is either the last expres
if (finallyBlock != null) { if (finallyBlock != null) {
blockStackElements.pop(); blockStackElements.pop();
} }
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -3692,7 +3692,7 @@ The "returned" value of try expression with no finally is either the last expres
} }
generateCheckCastInstruction(rightType, opToken == KtTokens.AS_SAFE); generateCheckCastInstruction(rightType, opToken == KtTokens.AS_SAFE);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -3808,7 +3808,7 @@ The "returned" value of try expression with no finally is either the last expres
SwitchCodegenUtil.buildAppropriateSwitchCodegenIfPossible(expression, isStatement, ExpressionCodegen.this); SwitchCodegenUtil.buildAppropriateSwitchCodegenIfPossible(expression, isStatement, ExpressionCodegen.this);
if (switchCodegen != null) { if (switchCodegen != null) {
switchCodegen.generate(); switchCodegen.generate();
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
int subjectLocal = expr != null ? myFrameMap.enterTemp(subjectType) : -1; int subjectLocal = expr != null ? myFrameMap.enterTemp(subjectType) : -1;
@@ -40,7 +40,7 @@ public class JvmRuntimeTypes {
public JvmRuntimeTypes() { public JvmRuntimeTypes() {
ModuleDescriptorImpl module = TargetPlatformKt.createModule( ModuleDescriptorImpl module = TargetPlatformKt.createModule(
JvmPlatform.INSTANCE$, JvmPlatform.INSTANCE,
Name.special("<jvm functions impl>"), Name.special("<jvm functions impl>"),
LockBasedStorageManager.NO_LOCKS LockBasedStorageManager.NO_LOCKS
); );
@@ -135,7 +135,7 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
@Override @Override
public Unit invoke(String message) { public Unit invoke(String message) {
messageSeverityCollector.report(CompilerMessageSeverity.ERROR, message, CompilerMessageLocation.NO_LOCATION); messageSeverityCollector.report(CompilerMessageSeverity.ERROR, message, CompilerMessageLocation.NO_LOCATION);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
})) { })) {
return COMPILATION_ERROR; return COMPILATION_ERROR;
@@ -175,7 +175,7 @@ public class CompileEnvironmentUtil {
} }
} }
} }
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -161,9 +161,9 @@ public enum TopDownAnalyzerFacadeForJVM {
@NotNull @NotNull
public static MutableModuleContext createContextWithSealedModule(@NotNull Project project, @NotNull String moduleName) { public static MutableModuleContext createContextWithSealedModule(@NotNull Project project, @NotNull String moduleName) {
MutableModuleContext context = ContextKt.ContextForNewModule( MutableModuleContext context = ContextKt.ContextForNewModule(
project, Name.special("<" + moduleName + ">"), JvmPlatform.INSTANCE$ project, Name.special("<" + moduleName + ">"), JvmPlatform.INSTANCE
); );
context.setDependencies(context.getModule(), JvmPlatform.INSTANCE$.getBuiltIns().getBuiltInsModule()); context.setDependencies(context.getModule(), JvmPlatform.INSTANCE.getBuiltIns().getBuiltInsModule());
return context; return context;
} }
} }
@@ -986,7 +986,7 @@ public class ControlFlowInformationProvider {
@Override @Override
public Unit invoke(Instruction instruction, D enterData, D exitData) { public Unit invoke(Instruction instruction, D enterData, D exitData) {
execute(instruction, enterData, exitData); execute(instruction, enterData, exitData);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
public abstract void execute(Instruction instruction, D enterData, D exitData); public abstract void execute(Instruction instruction, D enterData, D exitData);
@@ -996,7 +996,7 @@ public class ControlFlowInformationProvider {
@Override @Override
public Unit invoke(P p) { public Unit invoke(P p) {
execute(p); execute(p);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
public abstract void execute(P p); public abstract void execute(P p);
@@ -271,7 +271,7 @@ public class ControlFlowProcessor {
@NotNull @NotNull
private AccessTarget getResolvedCallAccessTarget(KtElement element) { private AccessTarget getResolvedCallAccessTarget(KtElement element) {
ResolvedCall<?> resolvedCall = CallUtilKt.getResolvedCall(element, trace.getBindingContext()); ResolvedCall<?> resolvedCall = CallUtilKt.getResolvedCall(element, trace.getBindingContext());
return resolvedCall != null ? new AccessTarget.Call(resolvedCall) : AccessTarget.BlackBox.INSTANCE$; return resolvedCall != null ? new AccessTarget.Call(resolvedCall) : AccessTarget.BlackBox.INSTANCE;
} }
@NotNull @NotNull
@@ -279,7 +279,7 @@ public class ControlFlowProcessor {
DeclarationDescriptor descriptor = trace.get(BindingContext.DECLARATION_TO_DESCRIPTOR, element); DeclarationDescriptor descriptor = trace.get(BindingContext.DECLARATION_TO_DESCRIPTOR, element);
return descriptor instanceof VariableDescriptor return descriptor instanceof VariableDescriptor
? new AccessTarget.Declaration((VariableDescriptor) descriptor) ? new AccessTarget.Declaration((VariableDescriptor) descriptor)
: AccessTarget.BlackBox.INSTANCE$; : AccessTarget.BlackBox.INSTANCE;
} }
@Override @Override
@@ -465,7 +465,7 @@ public class ControlFlowProcessor {
} }
Map<PseudoValue, ReceiverValue> receiverValues = SmartFMap.emptyMap(); Map<PseudoValue, ReceiverValue> receiverValues = SmartFMap.emptyMap();
AccessTarget accessTarget = AccessTarget.BlackBox.INSTANCE$; AccessTarget accessTarget = AccessTarget.BlackBox.INSTANCE;
if (left instanceof KtSimpleNameExpression || left instanceof KtQualifiedExpression) { if (left instanceof KtSimpleNameExpression || left instanceof KtQualifiedExpression) {
accessTarget = getResolvedCallAccessTarget(KtPsiUtilKt.getQualifiedElementSelector(left)); accessTarget = getResolvedCallAccessTarget(KtPsiUtilKt.getQualifiedElementSelector(left));
if (accessTarget instanceof AccessTarget.Call) { if (accessTarget instanceof AccessTarget.Call) {
@@ -476,7 +476,7 @@ public class ControlFlowProcessor {
accessTarget = getDeclarationAccessTarget(left); accessTarget = getDeclarationAccessTarget(left);
} }
if (accessTarget == AccessTarget.BlackBox.INSTANCE$ && !(left instanceof KtProperty)) { if (accessTarget == AccessTarget.BlackBox.INSTANCE && !(left instanceof KtProperty)) {
generateInstructions(left); generateInstructions(left);
createSyntheticValue(left, MagicKind.VALUE_CONSUMER, left); createSyntheticValue(left, MagicKind.VALUE_CONSUMER, left);
} }
@@ -519,7 +519,7 @@ public class ControlFlowInstructionsGenerator extends ControlFlowBuilderAdapter
@Nullable ResolvedCall<?> resolvedCall, @Nullable ResolvedCall<?> resolvedCall,
@NotNull Map<PseudoValue, ReceiverValue> receiverValues @NotNull Map<PseudoValue, ReceiverValue> receiverValues
) { ) {
AccessTarget accessTarget = resolvedCall != null ? new AccessTarget.Call(resolvedCall) : AccessTarget.BlackBox.INSTANCE$; AccessTarget accessTarget = resolvedCall != null ? new AccessTarget.Call(resolvedCall) : AccessTarget.BlackBox.INSTANCE;
ReadValueInstruction instruction = new ReadValueInstruction( ReadValueInstruction instruction = new ReadValueInstruction(
expression, getCurrentScope(), accessTarget, receiverValues, valueFactory expression, getCurrentScope(), accessTarget, receiverValues, valueFactory
); );
@@ -102,7 +102,7 @@ public class DefaultErrorMessages {
options.setWithoutTypeParameters(false); options.setWithoutTypeParameters(false);
options.setReceiverAfterName(false); options.setReceiverAfterName(false);
options.setRenderAccessors(true); options.setRenderAccessors(true);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -358,8 +358,8 @@ import static org.jetbrains.kotlin.lexer.KtTokens.*;
protected static void closeDeclarationWithCommentBinders(@NotNull PsiBuilder.Marker marker, @NotNull IElementType elementType, boolean precedingNonDocComments) { protected static void closeDeclarationWithCommentBinders(@NotNull PsiBuilder.Marker marker, @NotNull IElementType elementType, boolean precedingNonDocComments) {
marker.done(elementType); marker.done(elementType);
marker.setCustomEdgeTokenBinders(precedingNonDocComments ? PrecedingCommentsBinder.INSTANCE$ : PrecedingDocCommentsBinder.INSTANCE$, marker.setCustomEdgeTokenBinders(precedingNonDocComments ? PrecedingCommentsBinder.INSTANCE : PrecedingDocCommentsBinder.INSTANCE,
TrailingCommentsBinder.INSTANCE$); TrailingCommentsBinder.INSTANCE);
} }
protected abstract KotlinParsing create(SemanticWhitespaceAwarePsiBuilder builder); protected abstract KotlinParsing create(SemanticWhitespaceAwarePsiBuilder builder);
@@ -217,7 +217,7 @@ public class KotlinParsing extends AbstractKotlinParsing {
packageDirective = mark(); packageDirective = mark();
packageDirective.done(PACKAGE_DIRECTIVE); packageDirective.done(PACKAGE_DIRECTIVE);
// this is necessary to allow comments at the start of the file to be bound to the first declaration // this is necessary to allow comments at the start of the file to be bound to the first declaration
packageDirective.setCustomEdgeTokenBinders(DoNotBindAnything.INSTANCE$, null); packageDirective.setCustomEdgeTokenBinders(DoNotBindAnything.INSTANCE, null);
} }
parseImportDirectives(); parseImportDirectives();
@@ -347,7 +347,7 @@ public class KotlinParsing extends AbstractKotlinParsing {
} }
consumeIf(SEMICOLON); consumeIf(SEMICOLON);
importDirective.done(IMPORT_DIRECTIVE); importDirective.done(IMPORT_DIRECTIVE);
importDirective.setCustomEdgeTokenBinders(null, TrailingCommentsBinder.INSTANCE$); importDirective.setCustomEdgeTokenBinders(null, TrailingCommentsBinder.INSTANCE);
} }
private boolean closeImportWithErrorIfNewline(PsiBuilder.Marker importDirective, String errorMessage) { private boolean closeImportWithErrorIfNewline(PsiBuilder.Marker importDirective, String errorMessage) {
@@ -363,7 +363,7 @@ public class KotlinParsing extends AbstractKotlinParsing {
PsiBuilder.Marker importList = mark(); PsiBuilder.Marker importList = mark();
if (!at(IMPORT_KEYWORD)) { if (!at(IMPORT_KEYWORD)) {
// this is necessary to allow comments at the start of the file to be bound to the first declaration // this is necessary to allow comments at the start of the file to be bound to the first declaration
importList.setCustomEdgeTokenBinders(DoNotBindAnything.INSTANCE$, null); importList.setCustomEdgeTokenBinders(DoNotBindAnything.INSTANCE, null);
} }
while (at(IMPORT_KEYWORD)) { while (at(IMPORT_KEYWORD)) {
parseImportDirective(); parseImportDirective();
@@ -54,7 +54,7 @@ public class KtDotQualifiedExpression extends KtExpressionImplStub<KotlinPlaceHo
return childExpressionsByStub[0]; return childExpressionsByStub[0];
} }
} }
return KtQualifiedExpressionImpl.INSTANCE$.getReceiverExpression(this); return KtQualifiedExpressionImpl.INSTANCE.getReceiverExpression(this);
} }
@Nullable @Nullable
@@ -67,7 +67,7 @@ public class KtDotQualifiedExpression extends KtExpressionImplStub<KotlinPlaceHo
return childExpressionsByStub[1]; return childExpressionsByStub[1];
} }
} }
return KtQualifiedExpressionImpl.INSTANCE$.getSelectorExpression(this); return KtQualifiedExpressionImpl.INSTANCE.getSelectorExpression(this);
} }
@@ -93,12 +93,12 @@ public class KtDotQualifiedExpression extends KtExpressionImplStub<KotlinPlaceHo
@NotNull @NotNull
@Override @Override
public ASTNode getOperationTokenNode() { public ASTNode getOperationTokenNode() {
return KtQualifiedExpressionImpl.INSTANCE$.getOperationTokenNode(this); return KtQualifiedExpressionImpl.INSTANCE.getOperationTokenNode(this);
} }
@NotNull @NotNull
@Override @Override
public KtToken getOperationSign() { public KtToken getOperationSign() {
return KtQualifiedExpressionImpl.INSTANCE$.getOperationSign(this); return KtQualifiedExpressionImpl.INSTANCE.getOperationSign(this);
} }
} }
@@ -45,20 +45,20 @@ public class KtParameterList extends KtElementImplStub<KotlinPlaceHolderStub<KtP
@NotNull @NotNull
public KtParameter addParameter(@NotNull KtParameter parameter) { public KtParameter addParameter(@NotNull KtParameter parameter) {
return EditCommaSeparatedListHelper.INSTANCE$.addItem(this, getParameters(), parameter); return EditCommaSeparatedListHelper.INSTANCE.addItem(this, getParameters(), parameter);
} }
@NotNull @NotNull
public KtParameter addParameterAfter(@NotNull KtParameter parameter, @Nullable KtParameter anchor) { public KtParameter addParameterAfter(@NotNull KtParameter parameter, @Nullable KtParameter anchor) {
return EditCommaSeparatedListHelper.INSTANCE$.addItemAfter(this, getParameters(), parameter, anchor); return EditCommaSeparatedListHelper.INSTANCE.addItemAfter(this, getParameters(), parameter, anchor);
} }
@NotNull @NotNull
public KtParameter addParameterBefore(@NotNull KtParameter parameter, @Nullable KtParameter anchor) { public KtParameter addParameterBefore(@NotNull KtParameter parameter, @Nullable KtParameter anchor) {
return EditCommaSeparatedListHelper.INSTANCE$.addItemBefore(this, getParameters(), parameter, anchor); return EditCommaSeparatedListHelper.INSTANCE.addItemBefore(this, getParameters(), parameter, anchor);
} }
public void removeParameter(@NotNull KtParameter parameter) { public void removeParameter(@NotNull KtParameter parameter) {
EditCommaSeparatedListHelper.INSTANCE$.removeItem(parameter); EditCommaSeparatedListHelper.INSTANCE.removeItem(parameter);
} }
} }
@@ -34,24 +34,24 @@ public class KtSafeQualifiedExpression extends KtExpressionImpl implements KtQua
@NotNull @NotNull
@Override @Override
public KtExpression getReceiverExpression() { public KtExpression getReceiverExpression() {
return KtQualifiedExpressionImpl.INSTANCE$.getReceiverExpression(this); return KtQualifiedExpressionImpl.INSTANCE.getReceiverExpression(this);
} }
@Nullable @Nullable
@Override @Override
public KtExpression getSelectorExpression() { public KtExpression getSelectorExpression() {
return KtQualifiedExpressionImpl.INSTANCE$.getSelectorExpression(this); return KtQualifiedExpressionImpl.INSTANCE.getSelectorExpression(this);
} }
@NotNull @NotNull
@Override @Override
public ASTNode getOperationTokenNode() { public ASTNode getOperationTokenNode() {
return KtQualifiedExpressionImpl.INSTANCE$.getOperationTokenNode(this); return KtQualifiedExpressionImpl.INSTANCE.getOperationTokenNode(this);
} }
@NotNull @NotNull
@Override @Override
public KtToken getOperationSign() { public KtToken getOperationSign() {
return KtQualifiedExpressionImpl.INSTANCE$.getOperationSign(this); return KtQualifiedExpressionImpl.INSTANCE.getOperationSign(this);
} }
} }
@@ -52,21 +52,21 @@ public class KtValueArgumentList extends KtElementImpl {
@NotNull @NotNull
public KtValueArgument addArgument(@NotNull KtValueArgument argument) { public KtValueArgument addArgument(@NotNull KtValueArgument argument) {
return EditCommaSeparatedListHelper.INSTANCE$.addItem(this, getArguments(), argument); return EditCommaSeparatedListHelper.INSTANCE.addItem(this, getArguments(), argument);
} }
@NotNull @NotNull
public KtValueArgument addArgumentAfter(@NotNull KtValueArgument argument, @Nullable KtValueArgument anchor) { public KtValueArgument addArgumentAfter(@NotNull KtValueArgument argument, @Nullable KtValueArgument anchor) {
return EditCommaSeparatedListHelper.INSTANCE$.addItemAfter(this, getArguments(), argument, anchor); return EditCommaSeparatedListHelper.INSTANCE.addItemAfter(this, getArguments(), argument, anchor);
} }
@NotNull @NotNull
public KtValueArgument addArgumentBefore(@NotNull KtValueArgument argument, @Nullable KtValueArgument anchor) { public KtValueArgument addArgumentBefore(@NotNull KtValueArgument argument, @Nullable KtValueArgument anchor) {
return EditCommaSeparatedListHelper.INSTANCE$.addItemBefore(this, getArguments(), argument, anchor); return EditCommaSeparatedListHelper.INSTANCE.addItemBefore(this, getArguments(), argument, anchor);
} }
public void removeArgument(@NotNull KtValueArgument argument) { public void removeArgument(@NotNull KtValueArgument argument) {
assert argument.getParent() == this; assert argument.getParent() == this;
EditCommaSeparatedListHelper.INSTANCE$.removeItem(argument); EditCommaSeparatedListHelper.INSTANCE.removeItem(argument);
} }
} }
@@ -545,7 +545,7 @@ public class BodyResolver {
private void processModifiersOnInitializer(@NotNull KtModifierListOwner owner, @NotNull LexicalScope scope) { private void processModifiersOnInitializer(@NotNull KtModifierListOwner owner, @NotNull LexicalScope scope) {
annotationChecker.check(owner, trace, null); annotationChecker.check(owner, trace, null);
ModifierCheckerCore.INSTANCE$.check(owner, trace, null); ModifierCheckerCore.INSTANCE.check(owner, trace, null);
KtModifierList modifierList = owner.getModifierList(); KtModifierList modifierList = owner.getModifierList();
if (modifierList == null) return; if (modifierList == null) return;
@@ -582,7 +582,7 @@ public class BodyResolver {
valueParameterDescriptor : unsubstitutedPrimaryConstructor.getValueParameters()) { valueParameterDescriptor : unsubstitutedPrimaryConstructor.getValueParameters()) {
handler.addVariableDescriptor(valueParameterDescriptor); handler.addVariableDescriptor(valueParameterDescriptor);
} }
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -814,7 +814,7 @@ public class BodyResolver {
@Override @Override
public Unit invoke(LexicalScopeImpl.InitializeHandler handler) { public Unit invoke(LexicalScopeImpl.InitializeHandler handler) {
handler.addVariableDescriptor(fieldDescriptor); handler.addVariableDescriptor(fieldDescriptor);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
// Check parameter name shadowing // Check parameter name shadowing
@@ -83,7 +83,7 @@ public class FunctionDescriptorUtil {
for (ValueParameterDescriptor valueParameterDescriptor : descriptor.getValueParameters()) { for (ValueParameterDescriptor valueParameterDescriptor : descriptor.getValueParameters()) {
handler.addVariableDescriptor(valueParameterDescriptor); handler.addVariableDescriptor(valueParameterDescriptor);
} }
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -116,7 +116,7 @@ public class OverrideResolver {
if (element instanceof KtDeclaration) { if (element instanceof KtDeclaration) {
trace.report(CANNOT_INFER_VISIBILITY.on((KtDeclaration) element, descriptor)); trace.report(CANNOT_INFER_VISIBILITY.on((KtDeclaration) element, descriptor));
} }
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}; };
} }
@@ -171,7 +171,7 @@ public class OverrideResolver {
public boolean isEqual(D d1, D d2) { public boolean isEqual(D d1, D d2) {
CallableDescriptor f = transform.fun(d1); CallableDescriptor f = transform.fun(d1);
CallableDescriptor g = transform.fun(d2); CallableDescriptor g = transform.fun(d2);
return DescriptorEquivalenceForOverrides.INSTANCE$.areEquivalent(f.getOriginal(), g.getOriginal()); return DescriptorEquivalenceForOverrides.INSTANCE.areEquivalent(f.getOriginal(), g.getOriginal());
} }
}); });
@@ -218,10 +218,10 @@ public class OverrideResolver {
// when B is defined in modules m1 and m2, and C (indirectly) inherits from both versions, // when B is defined in modules m1 and m2, and C (indirectly) inherits from both versions,
// we'll be getting sets of members that do not override each other, but are structurally equivalent. // we'll be getting sets of members that do not override each other, but are structurally equivalent.
// As other code relies on no equal descriptors passed here, we guard against f == g, but this may not be necessary // As other code relies on no equal descriptors passed here, we guard against f == g, but this may not be necessary
if (!f.equals(g) && DescriptorEquivalenceForOverrides.INSTANCE$.areEquivalent(f.getOriginal(), g.getOriginal())) return true; if (!f.equals(g) && DescriptorEquivalenceForOverrides.INSTANCE.areEquivalent(f.getOriginal(), g.getOriginal())) return true;
CallableDescriptor originalG = g.getOriginal(); CallableDescriptor originalG = g.getOriginal();
for (D overriddenFunction : DescriptorUtils.getAllOverriddenDescriptors(f)) { for (D overriddenFunction : DescriptorUtils.getAllOverriddenDescriptors(f)) {
if (DescriptorEquivalenceForOverrides.INSTANCE$.areEquivalent(originalG, overriddenFunction.getOriginal())) return true; if (DescriptorEquivalenceForOverrides.INSTANCE.areEquivalent(originalG, overriddenFunction.getOriginal())) return true;
} }
return false; return false;
} }
@@ -287,7 +287,7 @@ public class CallResolver {
return resolveFunctionCall( return resolveFunctionCall(
BasicCallResolutionContext.create( BasicCallResolutionContext.create(
trace, scope, call, expectedType, dataFlowInfo, ContextDependency.INDEPENDENT, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS, trace, scope, call, expectedType, dataFlowInfo, ContextDependency.INDEPENDENT, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS,
CallChecker.DoNothing.INSTANCE$, isAnnotationContext CallChecker.DoNothing.INSTANCE, isAnnotationContext
) )
); );
} }
@@ -721,7 +721,7 @@ public class CallResolver {
candidateResolver.performResolutionForCandidateCall(context, task.checkArguments); candidateResolver.performResolutionForCandidateCall(context, task.checkArguments);
candidateResolutionContexts.add(context); candidateResolutionContexts.add(context);
} }
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -304,7 +304,7 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements MutableRe
if (ArgumentMappingKt.isReallySuccess(this)) { if (ArgumentMappingKt.isReallySuccess(this)) {
LOG.error("ArgumentUnmapped for " + valueArgument + " in successfully resolved call: " + call.getCallElement().getText()); LOG.error("ArgumentUnmapped for " + valueArgument + " in successfully resolved call: " + call.getCallElement().getText());
} }
return ArgumentUnmapped.INSTANCE$; return ArgumentUnmapped.INSTANCE;
} }
return argumentMatch; return argumentMatch;
} }
@@ -580,7 +580,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
@Override @Override
public Unit invoke(@NotNull Supertypes supertypes) { public Unit invoke(@NotNull Supertypes supertypes) {
findAndDisconnectLoopsInTypeHierarchy(supertypes.trueSupertypes); findAndDisconnectLoopsInTypeHierarchy(supertypes.trueSupertypes);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -51,7 +51,7 @@ public final class ScopeUtils {
for (TypeParameterDescriptor typeParameterDescriptor : propertyDescriptor.getTypeParameters()) { for (TypeParameterDescriptor typeParameterDescriptor : propertyDescriptor.getTypeParameters()) {
handler.addClassifierDescriptor(typeParameterDescriptor); handler.addClassifierDescriptor(typeParameterDescriptor);
} }
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
} }
@@ -979,7 +979,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
KtSimpleNameExpression labelExpression = expression.getTargetLabel(); KtSimpleNameExpression labelExpression = expression.getTargetLabel();
if (labelExpression != null) { if (labelExpression != null) {
PsiElement labelIdentifier = labelExpression.getIdentifier(); PsiElement labelIdentifier = labelExpression.getIdentifier();
UnderscoreChecker.INSTANCE$.checkIdentifier(labelIdentifier, context.trace); UnderscoreChecker.INSTANCE.checkIdentifier(labelIdentifier, context.trace);
} }
KtExpression baseExpression = expression.getBaseExpression(); KtExpression baseExpression = expression.getBaseExpression();
if (baseExpression == null) return TypeInfoFactoryKt.noTypeInfo(context); if (baseExpression == null) return TypeInfoFactoryKt.noTypeInfo(context);
@@ -481,7 +481,7 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor {
components.identifierChecker.checkDeclaration(catchParameter, context.trace); components.identifierChecker.checkDeclaration(catchParameter, context.trace);
ModifiersChecker.ModifiersCheckingProcedure modifiersChecking = components.modifiersChecker.withTrace(context.trace); ModifiersChecker.ModifiersCheckingProcedure modifiersChecking = components.modifiersChecker.withTrace(context.trace);
modifiersChecking.checkParameterHasNoValOrVar(catchParameter, VAL_OR_VAR_ON_CATCH_PARAMETER); modifiersChecking.checkParameterHasNoValOrVar(catchParameter, VAL_OR_VAR_ON_CATCH_PARAMETER);
ModifierCheckerCore.INSTANCE$.check(catchParameter, context.trace, null); ModifierCheckerCore.INSTANCE.check(catchParameter, context.trace, null);
VariableDescriptor variableDescriptor = components.descriptorResolver.resolveLocalVariableDescriptor( VariableDescriptor variableDescriptor = components.descriptorResolver.resolveLocalVariableDescriptor(
context.scope, catchParameter, context.trace); context.scope, catchParameter, context.trace);
@@ -37,7 +37,7 @@ public class ExpressionTypingContext extends ResolutionContext<ExpressionTypingC
@NotNull DataFlowInfo dataFlowInfo, @NotNull DataFlowInfo dataFlowInfo,
@NotNull KotlinType expectedType @NotNull KotlinType expectedType
) { ) {
return newContext(trace, scope, dataFlowInfo, expectedType, CallChecker.DoNothing.INSTANCE$); return newContext(trace, scope, dataFlowInfo, expectedType, CallChecker.DoNothing.INSTANCE);
} }
@NotNull @NotNull
@@ -133,7 +133,7 @@ public class JavaElementFinder extends PsiElementFinder implements KotlinFinderM
for (KtClassOrObject declaration : classOrObjectDeclarations) { for (KtClassOrObject declaration : classOrObjectDeclarations) {
if (!(declaration instanceof KtEnumEntry)) { if (!(declaration instanceof KtEnumEntry)) {
PsiClass lightClass = LightClassUtil.INSTANCE$.getPsiClass(declaration); PsiClass lightClass = LightClassUtil.INSTANCE.getPsiClass(declaration);
if (lightClass != null) { if (lightClass != null) {
answer.add(lightClass); answer.add(lightClass);
} }
@@ -149,7 +149,7 @@ public class JavaElementFinder extends PsiElementFinder implements KotlinFinderM
for (KtClassOrObject classOrObject : lightClassGenerationSupport.findClassOrObjectDeclarations(qualifiedName.parent(), scope)) { for (KtClassOrObject classOrObject : lightClassGenerationSupport.findClassOrObjectDeclarations(qualifiedName.parent(), scope)) {
//NOTE: can't filter out more interfaces right away because decompiled declarations do not have member bodies //NOTE: can't filter out more interfaces right away because decompiled declarations do not have member bodies
if (classOrObject instanceof KtClass && ((KtClass) classOrObject).isInterface()) { if (classOrObject instanceof KtClass && ((KtClass) classOrObject).isInterface()) {
PsiClass interfaceClass = LightClassUtil.INSTANCE$.getPsiClass(classOrObject); PsiClass interfaceClass = LightClassUtil.INSTANCE.getPsiClass(classOrObject);
if (interfaceClass != null) { if (interfaceClass != null) {
PsiClass implsClass = interfaceClass.findInnerClassByName(JvmAbi.DEFAULT_IMPLS_CLASS_NAME, false); PsiClass implsClass = interfaceClass.findInnerClassByName(JvmAbi.DEFAULT_IMPLS_CLASS_NAME, false);
if (implsClass != null) { if (implsClass != null) {
@@ -224,7 +224,7 @@ public class JavaElementFinder extends PsiElementFinder implements KotlinFinderM
Collection<KtClassOrObject> declarations = lightClassGenerationSupport.findClassOrObjectDeclarationsInPackage(packageFQN, scope); Collection<KtClassOrObject> declarations = lightClassGenerationSupport.findClassOrObjectDeclarationsInPackage(packageFQN, scope);
for (KtClassOrObject declaration : declarations) { for (KtClassOrObject declaration : declarations) {
PsiClass aClass = LightClassUtil.INSTANCE$.getPsiClass(declaration); PsiClass aClass = LightClassUtil.INSTANCE.getPsiClass(declaration);
if (aClass != null) { if (aClass != null) {
answer.add(aClass); answer.add(aClass);
} }
@@ -1,4 +1,4 @@
public class B { public class B {
public static int a = A.INSTANCE$.getC(); public static int a = A.INSTANCE.getC();
public static int b = A.INSTANCE$.foo(); public static int b = A.INSTANCE.foo();
} }
@@ -351,12 +351,12 @@ public abstract class AbstractDiagnosticsTest extends BaseDiagnosticsTest {
@NotNull @NotNull
protected TargetPlatform getPlatform() { protected TargetPlatform getPlatform() {
return JvmPlatform.INSTANCE$; return JvmPlatform.INSTANCE;
} }
@NotNull @NotNull
protected ModuleDescriptorImpl createModule(@NotNull String moduleName, @NotNull StorageManager storageManager) { protected ModuleDescriptorImpl createModule(@NotNull String moduleName, @NotNull StorageManager storageManager) {
return TargetPlatformKt.createModule(JvmPlatform.INSTANCE$, Name.special(moduleName), storageManager); return TargetPlatformKt.createModule(JvmPlatform.INSTANCE, Name.special(moduleName), storageManager);
} }
@NotNull @NotNull
@@ -76,7 +76,7 @@ public abstract class AbstractDiagnosticsTestWithJsStdLib extends AbstractDiagno
@NotNull @NotNull
@Override @Override
protected ModuleDescriptorImpl createModule(@NotNull String moduleName, @NotNull StorageManager storageManager) { protected ModuleDescriptorImpl createModule(@NotNull String moduleName, @NotNull StorageManager storageManager) {
return TargetPlatformKt.createModule(JsPlatform.INSTANCE$, Name.special(moduleName), storageManager); return TargetPlatformKt.createModule(JsPlatform.INSTANCE, Name.special(moduleName), storageManager);
} }
@NotNull @NotNull
@@ -104,6 +104,6 @@ public abstract class AbstractDiagnosticsTestWithJsStdLib extends AbstractDiagno
@NotNull @NotNull
@Override @Override
protected TargetPlatform getPlatform() { protected TargetPlatform getPlatform() {
return JsPlatform.INSTANCE$; return JsPlatform.INSTANCE;
} }
} }
@@ -131,7 +131,7 @@ public class CodegenTestFiles {
Object value; Object value;
KotlinType jetType; KotlinType jetType;
KotlinBuiltIns builtIns = JvmPlatform.INSTANCE$.getBuiltIns(); KotlinBuiltIns builtIns = JvmPlatform.INSTANCE.getBuiltIns();
if (type.equals("kotlin.String")) { if (type.equals("kotlin.String")) {
value = valueString; value = valueString;
jetType = builtIns.getStringType(); jetType = builtIns.getStringType();
@@ -37,7 +37,7 @@ public class ScriptGenTest extends CodegenTestCase {
private static final KotlinScriptDefinition FIB_SCRIPT_DEFINITION = private static final KotlinScriptDefinition FIB_SCRIPT_DEFINITION =
new TestScriptDefinition( new TestScriptDefinition(
".lang.kt", ".lang.kt",
singletonList(new ScriptParameter(Name.identifier("num"), JvmPlatform.INSTANCE$.getBuiltIns().getIntType())) singletonList(new ScriptParameter(Name.identifier("num"), JvmPlatform.INSTANCE.getBuiltIns().getIntType()))
); );
private static final KotlinScriptDefinition NO_PARAM_SCRIPT_DEFINITION = private static final KotlinScriptDefinition NO_PARAM_SCRIPT_DEFINITION =
new TestScriptDefinition( new TestScriptDefinition(
@@ -58,7 +58,7 @@ public abstract class AbstractCompileJavaAgainstKotlinTest extends TestCaseWithT
options.setVerbose(true); options.setVerbose(true);
options.setExcludedAnnotationClasses(Collections.singleton(new FqName(Retention.class.getName()))); options.setExcludedAnnotationClasses(Collections.singleton(new FqName(Retention.class.getName())));
options.setModifiers(DescriptorRendererModifier.ALL); options.setModifiers(DescriptorRendererModifier.ALL);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
) )
@@ -145,7 +145,7 @@ public abstract class ExpectedResolveData {
} }
public final void checkResult(BindingContext bindingContext) { public final void checkResult(BindingContext bindingContext) {
KotlinBuiltIns builtIns = JvmPlatform.INSTANCE$.getBuiltIns(); KotlinBuiltIns builtIns = JvmPlatform.INSTANCE.getBuiltIns();
Set<PsiElement> unresolvedReferences = Sets.newHashSet(); Set<PsiElement> unresolvedReferences = Sets.newHashSet();
for (Diagnostic diagnostic : bindingContext.getDiagnostics()) { for (Diagnostic diagnostic : bindingContext.getDiagnostics()) {
@@ -54,7 +54,7 @@ public class ExpectedResolveDataUtil {
} }
public static Map<String, DeclarationDescriptor> prepareDefaultNameToDescriptors(Project project, KotlinCoreEnvironment environment) { public static Map<String, DeclarationDescriptor> prepareDefaultNameToDescriptors(Project project, KotlinCoreEnvironment environment) {
KotlinBuiltIns builtIns = JvmPlatform.INSTANCE$.getBuiltIns(); KotlinBuiltIns builtIns = JvmPlatform.INSTANCE.getBuiltIns();
Map<String, DeclarationDescriptor> nameToDescriptor = new HashMap<String, DeclarationDescriptor>(); Map<String, DeclarationDescriptor> nameToDescriptor = new HashMap<String, DeclarationDescriptor>();
nameToDescriptor.put("kotlin::Int.plus(Int)", standardFunction(builtIns.getInt(), "plus", project, builtIns.getIntType())); nameToDescriptor.put("kotlin::Int.plus(Int)", standardFunction(builtIns.getInt(), "plus", project, builtIns.getIntType()));
@@ -135,7 +135,7 @@ public class ExpectedResolveDataUtil {
ModuleDescriptorImpl emptyModule = KotlinTestUtils.createEmptyModule(); ModuleDescriptorImpl emptyModule = KotlinTestUtils.createEmptyModule();
ContainerForTests container = InjectionKt.createContainerForTests(project, emptyModule); ContainerForTests container = InjectionKt.createContainerForTests(project, emptyModule);
emptyModule.setDependencies(emptyModule); emptyModule.setDependencies(emptyModule);
emptyModule.initialize(PackageFragmentProvider.Empty.INSTANCE$); emptyModule.initialize(PackageFragmentProvider.Empty.INSTANCE);
LexicalScopeImpl lexicalScope = new LexicalScopeImpl(ImportingScope.Empty.INSTANCE, classDescriptor, false, LexicalScopeImpl lexicalScope = new LexicalScopeImpl(ImportingScope.Empty.INSTANCE, classDescriptor, false,
classDescriptor.getThisAsReceiverParameter(), classDescriptor.getThisAsReceiverParameter(),
@@ -63,7 +63,7 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends KotlinLite
options.setVerbose(true); options.setVerbose(true);
options.setNameShortness(NameShortness.SHORT); options.setNameShortness(NameShortness.SHORT);
options.setModifiers(DescriptorRendererModifier.ALL); options.setModifiers(DescriptorRendererModifier.ALL);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -74,7 +74,7 @@ public class LoadBuiltinsTest extends KotlinTestWithEnvironment {
options.setVerbose(true); options.setVerbose(true);
options.setPrettyFunctionTypes(false); options.setPrettyFunctionTypes(false);
options.setModifiers(DescriptorRendererModifier.ALL); options.setModifiers(DescriptorRendererModifier.ALL);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
) )
@@ -104,13 +104,13 @@ public class LoadBuiltinsTest extends KotlinTestWithEnvironment {
private static PackageFragmentDescriptor createBuiltInsPackageFragment() { private static PackageFragmentDescriptor createBuiltInsPackageFragment() {
LockBasedStorageManager storageManager = new LockBasedStorageManager(); LockBasedStorageManager storageManager = new LockBasedStorageManager();
ModuleDescriptorImpl builtInsModule = new ModuleDescriptorImpl( ModuleDescriptorImpl builtInsModule = new ModuleDescriptorImpl(
Name.special("<built-ins module>"), storageManager, ModuleParameters.Empty.INSTANCE$, DefaultBuiltIns.getInstance() Name.special("<built-ins module>"), storageManager, ModuleParameters.Empty.INSTANCE, DefaultBuiltIns.getInstance()
); );
PackageFragmentProvider packageFragmentProvider = createBuiltInPackageFragmentProvider( PackageFragmentProvider packageFragmentProvider = createBuiltInPackageFragmentProvider(
storageManager, builtInsModule, BUILT_INS_PACKAGE_FQ_NAMES, storageManager, builtInsModule, BUILT_INS_PACKAGE_FQ_NAMES,
new BuiltInFictitiousFunctionClassFactory(storageManager, builtInsModule), new BuiltInFictitiousFunctionClassFactory(storageManager, builtInsModule),
AdditionalSupertypes.None.INSTANCE$, AdditionalSupertypes.None.INSTANCE,
new Function1<String, InputStream>() { new Function1<String, InputStream>() {
@Override @Override
public InputStream invoke(String path) { public InputStream invoke(String path) {
@@ -281,7 +281,7 @@ public class StorageManagerTest extends TestCase {
new Function1<String, Unit>() { new Function1<String, Unit>() {
@Override @Override
public Unit invoke(String s) { public Unit invoke(String s) {
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -317,7 +317,7 @@ public class StorageManagerTest extends TestCase {
public Unit invoke(String s) { public Unit invoke(String s) {
counter.inc(); counter.inc();
assertEquals("tolerant", s); assertEquals("tolerant", s);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -346,7 +346,7 @@ public class StorageManagerTest extends TestCase {
public Unit invoke(Collection<String> strings) { public Unit invoke(Collection<String> strings) {
counter.inc(); counter.inc();
strings.add("postComputed"); strings.add("postComputed");
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -372,7 +372,7 @@ public class StorageManagerTest extends TestCase {
public Unit invoke(Collection<String> strings) { public Unit invoke(Collection<String> strings) {
counter.inc(); counter.inc();
strings.add("postComputed"); strings.add("postComputed");
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -405,7 +405,7 @@ public class StorageManagerTest extends TestCase {
@Override @Override
public Unit invoke(String s) { public Unit invoke(String s) {
fail("Recursion-tolerating value should not be post computed"); fail("Recursion-tolerating value should not be post computed");
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -930,7 +930,7 @@ public class KotlinTestUtils {
@NotNull @NotNull
public static ModuleDescriptorImpl createEmptyModule(@NotNull String name) { public static ModuleDescriptorImpl createEmptyModule(@NotNull String name) {
return createEmptyModule(name, JvmPlatform.INSTANCE$); return createEmptyModule(name, JvmPlatform.INSTANCE);
} }
@NotNull @NotNull
@@ -57,7 +57,7 @@ public class RecursiveDescriptorComparator {
options.setNameShortness(NameShortness.FULLY_QUALIFIED); options.setNameShortness(NameShortness.FULLY_QUALIFIED);
options.setVerbose(true); options.setVerbose(true);
options.setModifiers(DescriptorRendererModifier.ALL); options.setModifiers(DescriptorRendererModifier.ALL);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -110,7 +110,7 @@ public class DefaultModalityModifiersTest extends KotlinLiteFixture {
new FileBasedDeclarationProviderFactory(moduleContext.getStorageManager(), new FileBasedDeclarationProviderFactory(moduleContext.getStorageManager(),
Collections.singleton(aClass.getContainingKtFile())), Collections.singleton(aClass.getContainingKtFile())),
new BindingTraceContext(), new BindingTraceContext(),
TargetPlatform.Default.INSTANCE$ TargetPlatform.Default.INSTANCE
); );
return (ClassDescriptorWithResolutionScopes) resolveSession.getClassDescriptor(aClass, NoLookupLocation.FROM_TEST); return (ClassDescriptorWithResolutionScopes) resolveSession.getClassDescriptor(aClass, NoLookupLocation.FROM_TEST);
@@ -172,7 +172,7 @@ public class KotlinOverloadTest extends KotlinLiteFixture {
private FunctionDescriptor makeFunction(String funDecl) { private FunctionDescriptor makeFunction(String funDecl) {
KtNamedFunction function = KtPsiFactoryKt.KtPsiFactory(getProject()).createFunction(funDecl); KtNamedFunction function = KtPsiFactoryKt.KtPsiFactory(getProject()).createFunction(funDecl);
LexicalScope scope = TypeTestUtilsKt.builtInPackageAsLexicalScope(JvmPlatform.INSTANCE$.getBuiltIns()); LexicalScope scope = TypeTestUtilsKt.builtInPackageAsLexicalScope(JvmPlatform.INSTANCE.getBuiltIns());
return functionDescriptorResolver.resolveFunctionDescriptor(root, scope, function, KotlinTestUtils.DUMMY_TRACE, DataFlowInfo.EMPTY); return functionDescriptorResolver.resolveFunctionDescriptor(root, scope, function, KotlinTestUtils.DUMMY_TRACE, DataFlowInfo.EMPTY);
} }
} }
@@ -76,7 +76,7 @@ public class KotlinTypeCheckerTest extends KotlinLiteFixture {
builtIns = module.getBuiltIns(); builtIns = module.getBuiltIns();
ContainerForTests container = InjectionKt.createContainerForTests(getProject(), module); ContainerForTests container = InjectionKt.createContainerForTests(getProject(), module);
module.setDependencies(Collections.singletonList(module)); module.setDependencies(Collections.singletonList(module));
module.initialize(PackageFragmentProvider.Empty.INSTANCE$); module.initialize(PackageFragmentProvider.Empty.INSTANCE);
typeResolver = container.getTypeResolver(); typeResolver = container.getTypeResolver();
expressionTypingServices = container.getExpressionTypingServices(); expressionTypingServices = container.getExpressionTypingServices();
@@ -56,7 +56,7 @@ public final class DescriptorResolverUtils {
@Override @Override
public Unit invoke(@NotNull CallableMemberDescriptor descriptor) { public Unit invoke(@NotNull CallableMemberDescriptor descriptor) {
errorReporter.reportCannotInferVisibility(descriptor); errorReporter.reportCannotInferVisibility(descriptor);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
result.add((D) fakeOverride); result.add((D) fakeOverride);
@@ -87,7 +87,7 @@ public class JavaMethodDescriptor extends SimpleFunctionDescriptorImpl implement
SimpleFunctionDescriptorImpl descriptor = super.initialize( SimpleFunctionDescriptorImpl descriptor = super.initialize(
receiverParameterType, dispatchReceiverParameter, typeParameters, unsubstitutedValueParameters, receiverParameterType, dispatchReceiverParameter, typeParameters, unsubstitutedValueParameters,
unsubstitutedReturnType, modality, visibility); unsubstitutedReturnType, modality, visibility);
setOperator(OperatorChecks.INSTANCE$.canBeOperator(descriptor)); setOperator(OperatorChecks.INSTANCE.canBeOperator(descriptor));
return descriptor; return descriptor;
} }
@@ -70,7 +70,7 @@ public abstract class KotlinBuiltIns {
protected KotlinBuiltIns() { protected KotlinBuiltIns() {
LockBasedStorageManager storageManager = new LockBasedStorageManager(); LockBasedStorageManager storageManager = new LockBasedStorageManager();
builtInsModule = new ModuleDescriptorImpl( builtInsModule = new ModuleDescriptorImpl(
Name.special("<built-ins module>"), storageManager, ModuleParameters.Empty.INSTANCE$, this Name.special("<built-ins module>"), storageManager, ModuleParameters.Empty.INSTANCE, this
); );
PackageFragmentProvider packageFragmentProvider = BuiltInsPackageFragmentProviderKt.createBuiltInPackageFragmentProvider( PackageFragmentProvider packageFragmentProvider = BuiltInsPackageFragmentProviderKt.createBuiltInPackageFragmentProvider(
@@ -101,7 +101,7 @@ public abstract class KotlinBuiltIns {
@NotNull @NotNull
protected AdditionalSupertypes getAdditionalSupertypesProvider() { protected AdditionalSupertypes getAdditionalSupertypesProvider() {
return AdditionalSupertypes.None.INSTANCE$; return AdditionalSupertypes.None.INSTANCE;
} }
private void makePrimitive(@NotNull PrimitiveType primitiveType) { private void makePrimitive(@NotNull PrimitiveType primitiveType) {
@@ -294,6 +294,6 @@ public class Visibilities {
static { static {
Iterator<ModuleVisibilityHelper> iterator = ServiceLoader.load(ModuleVisibilityHelper.class, ModuleVisibilityHelper.class.getClassLoader()).iterator(); Iterator<ModuleVisibilityHelper> iterator = ServiceLoader.load(ModuleVisibilityHelper.class, ModuleVisibilityHelper.class.getClassLoader()).iterator();
MODULE_VISIBILITY_HELPER = iterator.hasNext() ? iterator.next() : ModuleVisibilityHelper.EMPTY.INSTANCE$; MODULE_VISIBILITY_HELPER = iterator.hasNext() ? iterator.next() : ModuleVisibilityHelper.EMPTY.INSTANCE;
} }
} }
@@ -40,7 +40,7 @@ public class MemberComparator implements Comparator<DeclarationDescriptor> {
options.setWithDefinedIn(false); options.setWithDefinedIn(false);
options.setVerbose(true); options.setVerbose(true);
options.setModifiers(DescriptorRendererModifier.ALL); options.setModifiers(DescriptorRendererModifier.ALL);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
@@ -35,7 +35,7 @@ public abstract class AbstractKotlinType implements KotlinType {
@NotNull @NotNull
@Override @Override
public TypeCapabilities getCapabilities() { public TypeCapabilities getCapabilities() {
return TypeCapabilities.NONE.INSTANCE$; return TypeCapabilities.NONE.INSTANCE;
} }
@Override @Override
@@ -239,7 +239,7 @@ public class SourceNavigationHelper {
@NotNull Project project @NotNull Project project
) { ) {
TargetPlatform platform = TargetPlatform.Default.INSTANCE$; TargetPlatform platform = TargetPlatform.Default.INSTANCE;
MutableModuleContext newModuleContext = ContextKt.ContextForNewModule( MutableModuleContext newModuleContext = ContextKt.ContextForNewModule(
project, Name.special("<library module>"), project, Name.special("<library module>"),
ModuleDescriptorKt.ModuleParameters( ModuleDescriptorKt.ModuleParameters(
@@ -375,13 +375,13 @@ public class SourceNavigationHelper {
); );
} }
} }
return LightClassUtil.INSTANCE$.getPsiClass(classOrObject); return LightClassUtil.INSTANCE.getPsiClass(classOrObject);
} }
@Nullable @Nullable
public static PsiClass getOriginalClass(@NotNull KtClassOrObject classOrObject) { public static PsiClass getOriginalClass(@NotNull KtClassOrObject classOrObject) {
// Copied from JavaPsiImplementationHelperImpl:getOriginalClass() // Copied from JavaPsiImplementationHelperImpl:getOriginalClass()
String internalName = PsiCodegenPredictor.getPredefinedJvmInternalName(classOrObject, NoResolveFileClassesProvider.INSTANCE$); String internalName = PsiCodegenPredictor.getPredefinedJvmInternalName(classOrObject, NoResolveFileClassesProvider.INSTANCE);
if (internalName == null) { if (internalName == null) {
return null; return null;
} }
@@ -40,7 +40,7 @@ public class DuplicateJvmSignatureAnnotator implements Annotator {
if (!ProjectRootsUtil.isInProjectSource(element)) return; if (!ProjectRootsUtil.isInProjectSource(element)) return;
PsiFile file = element.getContainingFile(); PsiFile file = element.getContainingFile();
if (!(file instanceof KtFile) || TargetPlatformDetector.getPlatform((KtFile) file) != JvmPlatform.INSTANCE$) return; if (!(file instanceof KtFile) || TargetPlatformDetector.getPlatform((KtFile) file) != JvmPlatform.INSTANCE) return;
Diagnostics otherDiagnostics = ResolutionUtils.analyzeFully((KtElement) element).getDiagnostics(); Diagnostics otherDiagnostics = ResolutionUtils.analyzeFully((KtElement) element).getDiagnostics();
GlobalSearchScope moduleScope = GetModuleInfoKt.getModuleInfo(element).contentScope(); GlobalSearchScope moduleScope = GetModuleInfoKt.getModuleInfo(element).contentScope();
@@ -210,7 +210,7 @@ public class HtmlTabledDescriptorRenderer extends TabledDescriptorRenderer {
options.setModifiers(Collections.<DescriptorRendererModifier>emptySet()); options.setModifiers(Collections.<DescriptorRendererModifier>emptySet());
options.setValueParametersHandler(VALUE_PARAMETERS_HANDLER); options.setValueParametersHandler(VALUE_PARAMETERS_HANDLER);
options.setTextFormat(RenderingFormat.HTML); options.setTextFormat(RenderingFormat.HTML);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}); });
@@ -155,8 +155,8 @@ public class IdeErrorMessages {
"</html>", "</html>",
HTML_THROWABLE); HTML_THROWABLE);
MAP.put(ErrorsJs.JSCODE_ERROR, "<html>JavaScript: {0}</html>", JsCallDataHtmlRenderer.INSTANCE$); MAP.put(ErrorsJs.JSCODE_ERROR, "<html>JavaScript: {0}</html>", JsCallDataHtmlRenderer.INSTANCE);
MAP.put(ErrorsJs.JSCODE_WARNING, "<html>JavaScript: {0}</html>", JsCallDataHtmlRenderer.INSTANCE$); MAP.put(ErrorsJs.JSCODE_WARNING, "<html>JavaScript: {0}</html>", JsCallDataHtmlRenderer.INSTANCE);
MAP.setImmutable(); MAP.setImmutable();
} }
@@ -50,14 +50,14 @@ public class TargetPlatformDetector {
@NotNull @NotNull
public static TargetPlatform getPlatform(@NotNull Module module) { public static TargetPlatform getPlatform(@NotNull Module module) {
if (ProjectStructureUtil.isJsKotlinModule(module)) { if (ProjectStructureUtil.isJsKotlinModule(module)) {
return JsPlatform.INSTANCE$; return JsPlatform.INSTANCE;
} }
return JvmPlatform.INSTANCE$; return JvmPlatform.INSTANCE;
} }
@NotNull @NotNull
public static TargetPlatform getDefaultPlatform() { public static TargetPlatform getDefaultPlatform() {
LOG.info("Using default platform"); LOG.info("Using default platform");
return JvmPlatform.INSTANCE$; return JvmPlatform.INSTANCE;
} }
} }
@@ -33,7 +33,7 @@ public abstract class AbstractJSBasicCompletionTest extends KotlinFixtureComplet
@NotNull @NotNull
@Override @Override
public TargetPlatform getPlatform() { public TargetPlatform getPlatform() {
return JsPlatform.INSTANCE$; return JsPlatform.INSTANCE;
} }
@NotNull @NotNull
@@ -33,7 +33,7 @@ public abstract class AbstractJvmBasicCompletionTest extends KotlinFixtureComple
@NotNull @NotNull
@Override @Override
public TargetPlatform getPlatform() { public TargetPlatform getPlatform() {
return JvmPlatform.INSTANCE$; return JvmPlatform.INSTANCE;
} }
@NotNull @NotNull
@@ -33,7 +33,7 @@ public abstract class AbstractJvmSmartCompletionTest extends KotlinFixtureComple
@NotNull @NotNull
@Override @Override
public TargetPlatform getPlatform() { public TargetPlatform getPlatform() {
return JvmPlatform.INSTANCE$; return JvmPlatform.INSTANCE;
} }
@NotNull @NotNull
@@ -52,8 +52,8 @@ public class PluginStartupComponent implements ApplicationComponent {
public void initComponent() { public void initComponent() {
registerPathVariable(); registerPathVariable();
JarUserDataManager.INSTANCE$.register(KotlinJavaScriptLibraryDetectionUtil.HasKotlinJSMetadataInJar.INSTANCE$); JarUserDataManager.INSTANCE.register(KotlinJavaScriptLibraryDetectionUtil.HasKotlinJSMetadataInJar.INSTANCE);
JarUserDataManager.INSTANCE$.register(HasCompiledKotlinInJar.INSTANCE$); JarUserDataManager.INSTANCE.register(HasCompiledKotlinInJar.INSTANCE);
DebuggerFiltersUtilKt.addKotlinStdlibDebugFilterIfNeeded(); DebuggerFiltersUtilKt.addKotlinStdlibDebugFilterIfNeeded();
@@ -86,7 +86,7 @@ public class ConfigureKotlinInProjectUtils {
} }
private static void showConfigureKotlinNotification(@NotNull Project project) { private static void showConfigureKotlinNotification(@NotNull Project project) {
ConfigureKotlinNotificationManager.INSTANCE$.notify(project); ConfigureKotlinNotificationManager.INSTANCE.notify(project);
} }
@NotNull @NotNull
@@ -38,7 +38,7 @@ public class KotlinAndroidGradleModuleConfigurator extends KotlinWithGradleConfi
@NotNull @NotNull
@Override @Override
public TargetPlatform getTargetPlatform() { public TargetPlatform getTargetPlatform() {
return JvmPlatform.INSTANCE$; return JvmPlatform.INSTANCE;
} }
@NotNull @NotNull
@@ -38,7 +38,7 @@ public class KotlinGradleModuleConfigurator extends KotlinWithGradleConfigurator
@NotNull @NotNull
@Override @Override
public TargetPlatform getTargetPlatform() { public TargetPlatform getTargetPlatform() {
return JvmPlatform.INSTANCE$; return JvmPlatform.INSTANCE;
} }
@NotNull @NotNull
@@ -47,6 +47,6 @@ public class KotlinJavaMavenConfigurator extends KotlinMavenConfigurator {
@NotNull @NotNull
@Override @Override
public TargetPlatform getTargetPlatform() { public TargetPlatform getTargetPlatform() {
return JvmPlatform.INSTANCE$; return JvmPlatform.INSTANCE;
} }
} }
@@ -79,7 +79,7 @@ public class KotlinJavaModuleConfigurator extends KotlinWithLibraryConfigurator
@NotNull @NotNull
@Override @Override
public TargetPlatform getTargetPlatform() { public TargetPlatform getTargetPlatform() {
return JvmPlatform.INSTANCE$; return JvmPlatform.INSTANCE;
} }
@NotNull @NotNull
@@ -62,6 +62,6 @@ public class KotlinJavascriptMavenConfigurator extends KotlinMavenConfigurator {
@NotNull @NotNull
@Override @Override
public TargetPlatform getTargetPlatform() { public TargetPlatform getTargetPlatform() {
return JsPlatform.INSTANCE$; return JsPlatform.INSTANCE;
} }
} }
@@ -42,7 +42,7 @@ public class KotlinJsModuleConfigurator extends KotlinWithLibraryConfigurator {
@NotNull @NotNull
@Override @Override
public TargetPlatform getTargetPlatform() { public TargetPlatform getTargetPlatform() {
return JsPlatform.INSTANCE$; return JsPlatform.INSTANCE;
} }
@NotNull @NotNull
@@ -62,7 +62,7 @@ public class KotlinFindClassUsagesDialog extends FindClassUsagesDialog {
@NotNull @NotNull
private static PsiClass getRepresentingPsiClass(@NotNull KtClassOrObject classOrObject) { private static PsiClass getRepresentingPsiClass(@NotNull KtClassOrObject classOrObject) {
PsiClass lightClass = LightClassUtil.INSTANCE$.getPsiClass(classOrObject); PsiClass lightClass = LightClassUtil.INSTANCE.getPsiClass(classOrObject);
if (lightClass != null) return lightClass; if (lightClass != null) return lightClass;
// TODO: Remove this code when light classes are generated for builtins // TODO: Remove this code when light classes are generated for builtins
@@ -264,7 +264,7 @@ public class KotlinBlock extends AbstractBlock {
} }
} }
return WrappingStrategy.NoWrapping.INSTANCE$; return WrappingStrategy.NoWrapping.INSTANCE;
} }
private NodeAlignmentStrategy getChildrenAlignmentStrategy() { private NodeAlignmentStrategy getChildrenAlignmentStrategy() {
@@ -100,15 +100,15 @@ public class KotlinModuleSettingStep extends ModuleWizardStep {
@NotNull @NotNull
protected String getLibraryLabelText() { protected String getLibraryLabelText() {
if (targetPlatform == JvmPlatform.INSTANCE$) return "\u001BKotlin runtime:"; if (targetPlatform == JvmPlatform.INSTANCE) return "\u001BKotlin runtime:";
if (targetPlatform == JsPlatform.INSTANCE$) return "\u001BKotlin JS library:"; if (targetPlatform == JsPlatform.INSTANCE) return "\u001BKotlin JS library:";
throw new IllegalStateException("Only JS and JVM target are supported"); throw new IllegalStateException("Only JS and JVM target are supported");
} }
@NotNull @NotNull
protected CustomLibraryDescription getCustomLibraryDescription(@Nullable Project project) { protected CustomLibraryDescription getCustomLibraryDescription(@Nullable Project project) {
if (targetPlatform == JvmPlatform.INSTANCE$) return new JavaRuntimeLibraryDescription(project); if (targetPlatform == JvmPlatform.INSTANCE) return new JavaRuntimeLibraryDescription(project);
if (targetPlatform == JsPlatform.INSTANCE$) return new JSLibraryStdDescription(project); if (targetPlatform == JsPlatform.INSTANCE) return new JSLibraryStdDescription(project);
throw new IllegalStateException("Only JS and JVM target are supported"); throw new IllegalStateException("Only JS and JVM target are supported");
} }
@@ -92,17 +92,17 @@ public abstract class KotlinCallTreeStructure extends HierarchyTreeStructure {
} }
if (element instanceof KtNamedFunction || element instanceof KtSecondaryConstructor) { if (element instanceof KtNamedFunction || element instanceof KtSecondaryConstructor) {
return LightClassUtil.INSTANCE$.getLightClassMethod((KtFunction) element); return LightClassUtil.INSTANCE.getLightClassMethod((KtFunction) element);
} }
if (element instanceof KtProperty) { if (element instanceof KtProperty) {
LightClassUtil.PropertyAccessorsPsiMethods propertyMethods = LightClassUtil.PropertyAccessorsPsiMethods propertyMethods =
LightClassUtil.INSTANCE$.getLightClassPropertyMethods((KtProperty) element); LightClassUtil.INSTANCE.getLightClassPropertyMethods((KtProperty) element);
return (propertyMethods.getGetter() != null) ? propertyMethods.getGetter() : propertyMethods.getSetter(); return (propertyMethods.getGetter() != null) ? propertyMethods.getGetter() : propertyMethods.getSetter();
} }
if (element instanceof KtClassOrObject) { if (element instanceof KtClassOrObject) {
PsiClass psiClass = LightClassUtil.INSTANCE$.getPsiClass((KtClassOrObject) element); PsiClass psiClass = LightClassUtil.INSTANCE.getPsiClass((KtClassOrObject) element);
if (psiClass == null) return null; if (psiClass == null) return null;
PsiMethod[] constructors = psiClass.getConstructors(); PsiMethod[] constructors = psiClass.getConstructors();
@@ -104,18 +104,18 @@ public class KotlinCallerMethodsTreeStructure extends KotlinCallTreeStructure {
); );
} }
if (element instanceof KtNamedFunction || element instanceof KtSecondaryConstructor) { if (element instanceof KtNamedFunction || element instanceof KtSecondaryConstructor) {
Collection<PsiMethod> lightMethods = LightClassUtil.INSTANCE$.getLightClassMethods((KtFunction) element); Collection<PsiMethod> lightMethods = LightClassUtil.INSTANCE.getLightClassMethods((KtFunction) element);
processPsiMethodCallers(lightMethods, descriptor, methodToDescriptorMap, searchScope, false); processPsiMethodCallers(lightMethods, descriptor, methodToDescriptorMap, searchScope, false);
} }
if (element instanceof KtProperty) { if (element instanceof KtProperty) {
LightClassUtil.PropertyAccessorsPsiMethods propertyMethods = LightClassUtil.PropertyAccessorsPsiMethods propertyMethods =
LightClassUtil.INSTANCE$.getLightClassPropertyMethods((KtProperty) element); LightClassUtil.INSTANCE.getLightClassPropertyMethods((KtProperty) element);
processPsiMethodCallers(propertyMethods, descriptor, methodToDescriptorMap, searchScope, false); processPsiMethodCallers(propertyMethods, descriptor, methodToDescriptorMap, searchScope, false);
} }
if (element instanceof KtClassOrObject) { if (element instanceof KtClassOrObject) {
KtPrimaryConstructor constructor = ((KtClassOrObject) element).getPrimaryConstructor(); KtPrimaryConstructor constructor = ((KtClassOrObject) element).getPrimaryConstructor();
if (constructor != null) { if (constructor != null) {
PsiMethod lightMethod = LightClassUtil.INSTANCE$.getLightClassMethod(constructor); PsiMethod lightMethod = LightClassUtil.INSTANCE.getLightClassMethod(constructor);
processPsiMethodCallers(Collections.singleton(lightMethod), descriptor, methodToDescriptorMap, searchScope, false); processPsiMethodCallers(Collections.singleton(lightMethod), descriptor, methodToDescriptorMap, searchScope, false);
} }
else { else {
@@ -117,7 +117,7 @@ public class KotlinRefactoringUtil {
Project project = declaration.getProject(); Project project = declaration.getProject();
Map<PsiElement, CallableDescriptor> overriddenElementsToDescriptor = new HashMap<PsiElement, CallableDescriptor>(); Map<PsiElement, CallableDescriptor> overriddenElementsToDescriptor = new HashMap<PsiElement, CallableDescriptor>();
for (CallableDescriptor overriddenDescriptor : DescriptorUtils.getAllOverriddenDescriptors(declarationDescriptor)) { for (CallableDescriptor overriddenDescriptor : DescriptorUtils.getAllOverriddenDescriptors(declarationDescriptor)) {
PsiElement overriddenDeclaration = DescriptorToSourceUtilsIde.INSTANCE$.getAnyDeclaration(project, overriddenDescriptor); PsiElement overriddenDeclaration = DescriptorToSourceUtilsIde.INSTANCE.getAnyDeclaration(project, overriddenDescriptor);
if (PsiTreeUtil.instanceOf(overriddenDeclaration, KtNamedFunction.class, KtProperty.class, PsiMethod.class)) { if (PsiTreeUtil.instanceOf(overriddenDeclaration, KtNamedFunction.class, KtProperty.class, PsiMethod.class)) {
overriddenElementsToDescriptor.put(overriddenDeclaration, overriddenDescriptor); overriddenElementsToDescriptor.put(overriddenDeclaration, overriddenDescriptor);
} }
@@ -83,7 +83,7 @@ public class KotlinTestNgConfigurationProducer extends TestNGConfigurationProduc
KtElement owner = PsiTreeUtil.getParentOfType(function, KtFunction.class, KtClass.class); KtElement owner = PsiTreeUtil.getParentOfType(function, KtFunction.class, KtClass.class);
if (owner instanceof KtClass) { if (owner instanceof KtClass) {
PsiClass delegate = LightClassUtil.INSTANCE$.getPsiClass((KtClass) owner); PsiClass delegate = LightClassUtil.INSTANCE.getPsiClass((KtClass) owner);
if (delegate != null) { if (delegate != null) {
for (PsiMethod method : delegate.getMethods()) { for (PsiMethod method : delegate.getMethods()) {
if (method.getNavigationElement() == function) { if (method.getNavigationElement() == function) {
@@ -98,7 +98,7 @@ public class KotlinTestNgConfigurationProducer extends TestNGConfigurationProduc
} }
if (declarationToRun instanceof KtClass) { if (declarationToRun instanceof KtClass) {
PsiClass delegate = LightClassUtil.INSTANCE$.getPsiClass((KtClassOrObject) declarationToRun); PsiClass delegate = LightClassUtil.INSTANCE.getPsiClass((KtClassOrObject) declarationToRun);
if (!isTestNGClass(delegate)) { if (!isTestNGClass(delegate)) {
return false; return false;
} }
@@ -86,7 +86,7 @@ public class KotlinDefinitionsSearcher implements QueryExecutor<PsiElement, Defi
PsiClass psiClass = ApplicationManager.getApplication().runReadAction(new Computable<PsiClass>() { PsiClass psiClass = ApplicationManager.getApplication().runReadAction(new Computable<PsiClass>() {
@Override @Override
public PsiClass compute() { public PsiClass compute() {
return LightClassUtil.INSTANCE$.getPsiClass(klass); return LightClassUtil.INSTANCE.getPsiClass(klass);
} }
}); });
if (psiClass != null) { if (psiClass != null) {
@@ -99,7 +99,7 @@ public class KotlinDefinitionsSearcher implements QueryExecutor<PsiElement, Defi
PsiMethod psiMethod = ApplicationManager.getApplication().runReadAction(new Computable<PsiMethod>() { PsiMethod psiMethod = ApplicationManager.getApplication().runReadAction(new Computable<PsiMethod>() {
@Override @Override
public PsiMethod compute() { public PsiMethod compute() {
return LightClassUtil.INSTANCE$.getLightClassMethod(function); return LightClassUtil.INSTANCE.getLightClassMethod(function);
} }
}); });
@@ -115,7 +115,7 @@ public class KotlinDefinitionsSearcher implements QueryExecutor<PsiElement, Defi
new Computable<LightClassUtil.PropertyAccessorsPsiMethods>() { new Computable<LightClassUtil.PropertyAccessorsPsiMethods>() {
@Override @Override
public LightClassUtil.PropertyAccessorsPsiMethods compute() { public LightClassUtil.PropertyAccessorsPsiMethods compute() {
return LightClassUtil.INSTANCE$.getLightClassPropertyMethods(parameter); return LightClassUtil.INSTANCE.getLightClassPropertyMethods(parameter);
} }
}); });
@@ -127,7 +127,7 @@ public class KotlinDefinitionsSearcher implements QueryExecutor<PsiElement, Defi
new Computable<LightClassUtil.PropertyAccessorsPsiMethods>() { new Computable<LightClassUtil.PropertyAccessorsPsiMethods>() {
@Override @Override
public LightClassUtil.PropertyAccessorsPsiMethods compute() { public LightClassUtil.PropertyAccessorsPsiMethods compute() {
return LightClassUtil.INSTANCE$.getLightClassPropertyMethods(property); return LightClassUtil.INSTANCE.getLightClassPropertyMethods(property);
} }
}); });
@@ -67,7 +67,7 @@ public class KotlinRuntimeLibraryUtil {
@NotNull @NotNull
public static Collection<VirtualFile> getLibraryRootsWithAbiIncompatibleKotlinClasses(@NotNull Project project) { public static Collection<VirtualFile> getLibraryRootsWithAbiIncompatibleKotlinClasses(@NotNull Project project) {
return getLibraryRootsWithAbiIncompatibleVersion( return getLibraryRootsWithAbiIncompatibleVersion(
project, KotlinAbiVersionIndex.INSTANCE$, project, KotlinAbiVersionIndex.INSTANCE,
new Function1<Module, Boolean>() { new Function1<Module, Boolean>() {
@Override @Override
public Boolean invoke(@Nullable Module module) { public Boolean invoke(@Nullable Module module) {
@@ -85,7 +85,7 @@ public class KotlinRuntimeLibraryUtil {
@NotNull @NotNull
public static Collection<VirtualFile> getLibraryRootsWithAbiIncompatibleForKotlinJs(@NotNull Project project) { public static Collection<VirtualFile> getLibraryRootsWithAbiIncompatibleForKotlinJs(@NotNull Project project) {
return getLibraryRootsWithAbiIncompatibleVersion( return getLibraryRootsWithAbiIncompatibleVersion(
project, KotlinJavaScriptAbiVersionIndex.INSTANCE$, project, KotlinJavaScriptAbiVersionIndex.INSTANCE,
new Function1<Module, Boolean>() { new Function1<Module, Boolean>() {
@Override @Override
public Boolean invoke(@Nullable Module module) { public Boolean invoke(@Nullable Module module) {
@@ -1,5 +1,5 @@
// "Replace with reference to 'INSTANCE' field" "true" // "Replace with reference to 'INSTANCE' field" "true"
import static a.A.INSTANCE$; import static a.A.INSTANCE;
class B { class B {
void bar() { void bar() {
@@ -38,11 +38,11 @@ public abstract class AbstractPsiCheckerTest extends KotlinLightCodeInsightFixtu
//noinspection unchecked //noinspection unchecked
myFixture.enableInspections(SpellCheckingInspection.class); myFixture.enableInspections(SpellCheckingInspection.class);
NameHighlighter.INSTANCE$.setNamesHighlightingEnabled(false); NameHighlighter.INSTANCE.setNamesHighlightingEnabled(false);
checkHighlighting(true, true, false); checkHighlighting(true, true, false);
} }
finally { finally {
NameHighlighter.INSTANCE$.setNamesHighlightingEnabled(true); NameHighlighter.INSTANCE.setNamesHighlightingEnabled(true);
} }
} }
@@ -123,13 +123,13 @@ public abstract class AbstractIntentionTest extends KotlinCodeInsightTestCase {
} }
if (getFile() instanceof KtFile && !InTextDirectivesUtils.isDirectiveDefined(fileText, "// SKIP_ERRORS_BEFORE")) { if (getFile() instanceof KtFile && !InTextDirectivesUtils.isDirectiveDefined(fileText, "// SKIP_ERRORS_BEFORE")) {
DirectiveBasedActionUtils.INSTANCE$.checkForUnexpectedErrors((KtFile) getFile()); DirectiveBasedActionUtils.INSTANCE.checkForUnexpectedErrors((KtFile) getFile());
} }
doTestFor(pathToFile, intentionAction, fileText); doTestFor(pathToFile, intentionAction, fileText);
if (getFile() instanceof KtFile && !InTextDirectivesUtils.isDirectiveDefined(fileText, "// SKIP_ERRORS_AFTER")) { if (getFile() instanceof KtFile && !InTextDirectivesUtils.isDirectiveDefined(fileText, "// SKIP_ERRORS_AFTER")) {
DirectiveBasedActionUtils.INSTANCE$.checkForUnexpectedErrors((KtFile) getFile()); DirectiveBasedActionUtils.INSTANCE.checkForUnexpectedErrors((KtFile) getFile());
} }
} }
finally { finally {
@@ -212,7 +212,7 @@ public class KotlinJavaFacadeTest extends KotlinLightCodeInsightFixtureTestCase
assertInstanceOf(element, KtClass.class); assertInstanceOf(element, KtClass.class);
KtClass aClass = (KtClass) element; KtClass aClass = (KtClass) element;
PsiClass createdByWrapDelegate = LightClassUtil.INSTANCE$.getPsiClass(aClass); PsiClass createdByWrapDelegate = LightClassUtil.INSTANCE.getPsiClass(aClass);
assertNull(createdByWrapDelegate); assertNull(createdByWrapDelegate);
} }
@@ -220,7 +220,7 @@ public class KotlinJavaFacadeTest extends KotlinLightCodeInsightFixtureTestCase
KtNamedFunction jetFunction = getPreparedElement(KtNamedFunction.class); KtNamedFunction jetFunction = getPreparedElement(KtNamedFunction.class);
// Should not fail! // Should not fail!
PsiMethod psiMethod = LightClassUtil.INSTANCE$.getLightClassMethod(jetFunction); PsiMethod psiMethod = LightClassUtil.INSTANCE.getLightClassMethod(jetFunction);
checkDeclarationMethodWrapped(shouldBeWrapped, jetFunction, psiMethod); checkDeclarationMethodWrapped(shouldBeWrapped, jetFunction, psiMethod);
} }
@@ -229,7 +229,7 @@ public class KotlinJavaFacadeTest extends KotlinLightCodeInsightFixtureTestCase
KtParameter jetParameter = getPreparedElement(KtParameter.class); KtParameter jetParameter = getPreparedElement(KtParameter.class);
// Should not fail! // Should not fail!
LightClassUtil.PropertyAccessorsPsiMethods propertyAccessors = LightClassUtil.INSTANCE$.getLightClassPropertyMethods(jetParameter); LightClassUtil.PropertyAccessorsPsiMethods propertyAccessors = LightClassUtil.INSTANCE.getLightClassPropertyMethods(jetParameter);
checkDeclarationMethodWrapped(shouldWrapGetter, jetParameter, propertyAccessors.getGetter()); checkDeclarationMethodWrapped(shouldWrapGetter, jetParameter, propertyAccessors.getGetter());
checkDeclarationMethodWrapped(shouldWrapSetter, jetParameter, propertyAccessors.getSetter()); checkDeclarationMethodWrapped(shouldWrapSetter, jetParameter, propertyAccessors.getSetter());
@@ -239,7 +239,7 @@ public class KotlinJavaFacadeTest extends KotlinLightCodeInsightFixtureTestCase
KtProperty jetProperty = getPreparedElement(KtProperty.class); KtProperty jetProperty = getPreparedElement(KtProperty.class);
// Should not fail! // Should not fail!
LightClassUtil.PropertyAccessorsPsiMethods propertyAccessors = LightClassUtil.INSTANCE$.getLightClassPropertyMethods(jetProperty); LightClassUtil.PropertyAccessorsPsiMethods propertyAccessors = LightClassUtil.INSTANCE.getLightClassPropertyMethods(jetProperty);
checkDeclarationMethodWrapped(shouldWrapGetter, jetProperty, propertyAccessors.getGetter()); checkDeclarationMethodWrapped(shouldWrapGetter, jetProperty, propertyAccessors.getGetter());
checkDeclarationMethodWrapped(shouldWrapSetter, jetProperty, propertyAccessors.getSetter()); checkDeclarationMethodWrapped(shouldWrapSetter, jetProperty, propertyAccessors.getSetter());
@@ -249,7 +249,7 @@ public class KotlinJavaFacadeTest extends KotlinLightCodeInsightFixtureTestCase
KtPropertyAccessor jetPropertyAccessor = getPreparedElement(KtPropertyAccessor.class); KtPropertyAccessor jetPropertyAccessor = getPreparedElement(KtPropertyAccessor.class);
// Should not fail! // Should not fail!
PsiMethod propertyAccessors = LightClassUtil.INSTANCE$.getLightClassAccessorMethod(jetPropertyAccessor); PsiMethod propertyAccessors = LightClassUtil.INSTANCE.getLightClassAccessorMethod(jetPropertyAccessor);
checkDeclarationMethodWrapped(shouldWrapAccessor, checkDeclarationMethodWrapped(shouldWrapAccessor,
PsiTreeUtil.getParentOfType(jetPropertyAccessor, KtProperty.class), PsiTreeUtil.getParentOfType(jetPropertyAccessor, KtProperty.class),
propertyAccessors); propertyAccessors);
@@ -296,7 +296,7 @@ public class KotlinJavaFacadeTest extends KotlinLightCodeInsightFixtureTestCase
assertNotNull("Caret should be placed to class definition", ktClass); assertNotNull("Caret should be placed to class definition", ktClass);
// Should not fail! // Should not fail!
KtLightClass lightClass = (KtLightClass) LightClassUtil.INSTANCE$.getPsiClass(ktClass); KtLightClass lightClass = (KtLightClass) LightClassUtil.INSTANCE.getPsiClass(ktClass);
assertNotNull(String.format("Failed to wrap jetClass '%s' to class", ktClass.getText()), lightClass); assertNotNull(String.format("Failed to wrap jetClass '%s' to class", ktClass.getText()), lightClass);
@@ -58,8 +58,8 @@ public class LightClassEqualsTest extends KotlinLightCodeInsightFixtureTestCase
private static void doTestEquals(@Nullable KtClassOrObject origin) { private static void doTestEquals(@Nullable KtClassOrObject origin) {
assertNotNull(origin); assertNotNull(origin);
PsiClass lightClass1 = LightClassUtil.INSTANCE$.getPsiClass(origin); PsiClass lightClass1 = LightClassUtil.INSTANCE.getPsiClass(origin);
PsiClass lightClass2 = LightClassUtil.INSTANCE$.getPsiClass(origin); PsiClass lightClass2 = LightClassUtil.INSTANCE.getPsiClass(origin);
assertNotNull(lightClass1); assertNotNull(lightClass1);
assertNotNull(lightClass2); assertNotNull(lightClass2);
@@ -180,7 +180,7 @@ public abstract class AbstractQuickFixMultiFileTest extends KotlinDaemonAnalyzer
boolean actionShouldBeAvailable = pair.getSecond(); boolean actionShouldBeAvailable = pair.getSecond();
if (psiFile instanceof KtFile) { if (psiFile instanceof KtFile) {
DirectiveBasedActionUtils.INSTANCE$.checkForUnexpectedErrors((KtFile) psiFile); DirectiveBasedActionUtils.INSTANCE.checkForUnexpectedErrors((KtFile) psiFile);
} }
doAction(text, actionShouldBeAvailable, getTestName(false)); doAction(text, actionShouldBeAvailable, getTestName(false));
@@ -270,7 +270,7 @@ public abstract class AbstractQuickFixMultiFileTest extends KotlinDaemonAnalyzer
boolean actionShouldBeAvailable = pair.getSecond(); boolean actionShouldBeAvailable = pair.getSecond();
if (psiFile instanceof KtFile) { if (psiFile instanceof KtFile) {
DirectiveBasedActionUtils.INSTANCE$.checkForUnexpectedErrors((KtFile) psiFile); DirectiveBasedActionUtils.INSTANCE.checkForUnexpectedErrors((KtFile) psiFile);
} }
doAction(text, actionShouldBeAvailable, beforeFileName); doAction(text, actionShouldBeAvailable, beforeFileName);
@@ -341,7 +341,7 @@ public abstract class AbstractQuickFixMultiFileTest extends KotlinDaemonAnalyzer
"Infos:" + infos); "Infos:" + infos);
} }
else { else {
DirectiveBasedActionUtils.INSTANCE$.checkAvailableActionsAreExpected(getFile(), availableActions); DirectiveBasedActionUtils.INSTANCE.checkAvailableActionsAreExpected(getFile(), availableActions);
} }
} }
else { else {
@@ -42,13 +42,13 @@ public abstract class AbstractMultiFileHighlightingTest extends CompletionTestCa
public void doTest(@NotNull String filePath) throws Exception { public void doTest(@NotNull String filePath) throws Exception {
configureByFile(new File(filePath).getName(), ""); configureByFile(new File(filePath).getName(), "");
boolean shouldFail = getName().contains("UnspecifiedType"); boolean shouldFail = getName().contains("UnspecifiedType");
AstAccessControl.INSTANCE$.testWithControlledAccessToAst( AstAccessControl.INSTANCE.testWithControlledAccessToAst(
shouldFail, getFile().getVirtualFile(), getProject(), getTestRootDisposable(), shouldFail, getFile().getVirtualFile(), getProject(), getTestRootDisposable(),
new Function0<Unit>() { new Function0<Unit>() {
@Override @Override
public Unit invoke() { public Unit invoke() {
checkHighlighting(myEditor, true, false); checkHighlighting(myEditor, true, false);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -43,13 +43,13 @@ public abstract class AbstractResolveByStubTest extends KotlinCodeInsightTestCas
configureByFile(path); configureByFile(path);
TestUtilsKt.configureAs(getModule(), KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE); TestUtilsKt.configureAs(getModule(), KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE);
boolean shouldFail = getTestName(false).equals("ClassWithConstVal"); boolean shouldFail = getTestName(false).equals("ClassWithConstVal");
AstAccessControl.INSTANCE$.testWithControlledAccessToAst( AstAccessControl.INSTANCE.testWithControlledAccessToAst(
shouldFail, getProject(), getTestRootDisposable(), shouldFail, getProject(), getTestRootDisposable(),
new Function0<Unit>() { new Function0<Unit>() {
@Override @Override
public Unit invoke() { public Unit invoke() {
performTest(path, checkPrimaryConstructors, checkPropertyAccessors); performTest(path, checkPrimaryConstructors, checkPropertyAccessors);
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
} }
); );
@@ -26,7 +26,7 @@ public class JsEmptyExpression extends JsExpressionImpl {
@Override @Override
@NotNull @NotNull
public JsStatement makeStmt() { public JsStatement makeStmt() {
return JsEmpty.INSTANCE$; return JsEmpty.INSTANCE;
} }
@Override @Override
@@ -48,7 +48,7 @@ public final class TopDownAnalyzerFacadeForJS {
BindingTrace trace = new BindingTraceContext(); BindingTrace trace = new BindingTraceContext();
MutableModuleContext newModuleContext = ContextKt.ContextForNewModule( MutableModuleContext newModuleContext = ContextKt.ContextForNewModule(
config.getProject(), Name.special("<" + config.getModuleId() + ">"), JsPlatform.INSTANCE$ config.getProject(), Name.special("<" + config.getModuleId() + ">"), JsPlatform.INSTANCE
); );
newModuleContext.setDependencies(computeDependencies(newModuleContext.getModule(), config)); newModuleContext.setDependencies(computeDependencies(newModuleContext.getModule(), config));
return analyzeFilesWithGivenTrace(files, trace, newModuleContext, config); return analyzeFilesWithGivenTrace(files, trace, newModuleContext, config);
@@ -59,7 +59,7 @@ public final class TopDownAnalyzerFacadeForJS {
List<ModuleDescriptorImpl> allDependencies = new ArrayList<ModuleDescriptorImpl>(); List<ModuleDescriptorImpl> allDependencies = new ArrayList<ModuleDescriptorImpl>();
allDependencies.add(module); allDependencies.add(module);
allDependencies.addAll(config.getModuleDescriptors()); allDependencies.addAll(config.getModuleDescriptors());
allDependencies.add(JsPlatform.INSTANCE$.getBuiltIns().getBuiltInsModule()); allDependencies.add(JsPlatform.INSTANCE.getBuiltIns().getBuiltInsModule());
return allDependencies; return allDependencies;
} }
@@ -160,19 +160,19 @@ public abstract class Config {
", but metadata.abiVersion = " + metadata.getAbiVersion(); ", but metadata.abiVersion = " + metadata.getAbiVersion();
ModuleDescriptorImpl moduleDescriptor = TargetPlatformKt.createModule( ModuleDescriptorImpl moduleDescriptor = TargetPlatformKt.createModule(
JsPlatform.INSTANCE$, Name.special("<" + metadata.getModuleName() + ">"), storageManager JsPlatform.INSTANCE, Name.special("<" + metadata.getModuleName() + ">"), storageManager
); );
PackageFragmentProvider provider = PackageFragmentProvider provider =
KotlinJavascriptSerializationUtil.createPackageFragmentProvider(moduleDescriptor, metadata.getBody(), storageManager); KotlinJavascriptSerializationUtil.createPackageFragmentProvider(moduleDescriptor, metadata.getBody(), storageManager);
moduleDescriptor.initialize(provider != null ? provider : PackageFragmentProvider.Empty.INSTANCE$); moduleDescriptor.initialize(provider != null ? provider : PackageFragmentProvider.Empty.INSTANCE);
return moduleDescriptor; return moduleDescriptor;
} }
private static void setDependencies(ModuleDescriptorImpl module, List<ModuleDescriptorImpl> modules) { private static void setDependencies(ModuleDescriptorImpl module, List<ModuleDescriptorImpl> modules) {
module.setDependencies(CollectionsKt.plus(modules, JsPlatform.INSTANCE$.getBuiltIns().getBuiltInsModule())); module.setDependencies(CollectionsKt.plus(modules, JsPlatform.INSTANCE.getBuiltIns().getBuiltInsModule()));
} }
@NotNull @NotNull
@@ -114,7 +114,7 @@ public class LibrarySourcesConfig extends Config {
metadata.addAll(KotlinJavascriptMetadataUtils.loadMetadata(libraryPath)); metadata.addAll(KotlinJavascriptMetadataUtils.loadMetadata(libraryPath));
} }
return Unit.INSTANCE$; return Unit.INSTANCE;
} }
}; };
@@ -37,8 +37,8 @@ public interface ErrorsJs {
DiagnosticFactory0<KtDeclaration> NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE = DiagnosticFactory0.create(ERROR, DECLARATION_RETURN_TYPE); DiagnosticFactory0<KtDeclaration> NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE = DiagnosticFactory0.create(ERROR, DECLARATION_RETURN_TYPE);
DiagnosticFactory0<KtDeclaration> NATIVE_SETTER_WRONG_RETURN_TYPE = DiagnosticFactory0.create(ERROR, DECLARATION_RETURN_TYPE); DiagnosticFactory0<KtDeclaration> NATIVE_SETTER_WRONG_RETURN_TYPE = DiagnosticFactory0.create(ERROR, DECLARATION_RETURN_TYPE);
DiagnosticFactory2<KtElement, Integer, String> NATIVE_INDEXER_WRONG_PARAMETER_COUNT = DiagnosticFactory2.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT); DiagnosticFactory2<KtElement, Integer, String> NATIVE_INDEXER_WRONG_PARAMETER_COUNT = DiagnosticFactory2.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT);
DiagnosticFactory1<KtExpression, JsCallData> JSCODE_ERROR = DiagnosticFactory1.create(ERROR, JsCodePositioningStrategy.INSTANCE$); DiagnosticFactory1<KtExpression, JsCallData> JSCODE_ERROR = DiagnosticFactory1.create(ERROR, JsCodePositioningStrategy.INSTANCE);
DiagnosticFactory1<KtExpression, JsCallData> JSCODE_WARNING = DiagnosticFactory1.create(WARNING, JsCodePositioningStrategy.INSTANCE$); DiagnosticFactory1<KtExpression, JsCallData> JSCODE_WARNING = DiagnosticFactory1.create(WARNING, JsCodePositioningStrategy.INSTANCE);
DiagnosticFactory0<KtExpression> JSCODE_ARGUMENT_SHOULD_BE_CONSTANT = DiagnosticFactory0.create(ERROR, DEFAULT); DiagnosticFactory0<KtExpression> JSCODE_ARGUMENT_SHOULD_BE_CONSTANT = DiagnosticFactory0.create(ERROR, DEFAULT);
DiagnosticFactory1<KtElement, KtElement> NOT_SUPPORTED = DiagnosticFactory1.create(ERROR, DEFAULT); DiagnosticFactory1<KtElement, KtElement> NOT_SUPPORTED = DiagnosticFactory1.create(ERROR, DEFAULT);
DiagnosticFactory1<KtElement, KtElement> REFERENCE_TO_BUILTIN_MEMBERS_NOT_SUPPORTED = DiagnosticFactory1.create(ERROR, DEFAULT); DiagnosticFactory1<KtElement, KtElement> REFERENCE_TO_BUILTIN_MEMBERS_NOT_SUPPORTED = DiagnosticFactory1.create(ERROR, DEFAULT);
@@ -517,7 +517,7 @@ public class JsAstMapper {
toForIn.setBody(bodyStmt); toForIn.setBody(bodyStmt);
} }
else { else {
toForIn.setBody(JsEmpty.INSTANCE$); toForIn.setBody(JsEmpty.INSTANCE);
} }
return toForIn; return toForIn;
@@ -545,7 +545,7 @@ public class JsAstMapper {
toFor.setBody(bodyStmt); toFor.setBody(bodyStmt);
} }
else { else {
toFor.setBody(JsEmpty.INSTANCE$); toFor.setBody(JsEmpty.INSTANCE);
} }
return toFor; return toFor;
} }
@@ -892,7 +892,7 @@ public class JsAstMapper {
else { else {
// When map() returns null, we return an empty statement. // When map() returns null, we return an empty statement.
// //
return JsEmpty.INSTANCE$; return JsEmpty.INSTANCE;
} }
} }
@@ -46,8 +46,8 @@ public final class Namer {
public static final JsNameRef KOTLIN_OBJECT_REF = new JsNameRef(KOTLIN_NAME); public static final JsNameRef KOTLIN_OBJECT_REF = new JsNameRef(KOTLIN_NAME);
public static final JsNameRef KOTLIN_LONG_NAME_REF = new JsNameRef("Long", KOTLIN_OBJECT_REF); public static final JsNameRef KOTLIN_LONG_NAME_REF = new JsNameRef("Long", KOTLIN_OBJECT_REF);
public static final String EQUALS_METHOD_NAME = getStableMangledNameForDescriptor(JsPlatform.INSTANCE$.getBuiltIns().getAny(), "equals"); public static final String EQUALS_METHOD_NAME = getStableMangledNameForDescriptor(JsPlatform.INSTANCE.getBuiltIns().getAny(), "equals");
public static final String COMPARE_TO_METHOD_NAME = getStableMangledNameForDescriptor(JsPlatform.INSTANCE$.getBuiltIns().getComparable(), "compareTo"); public static final String COMPARE_TO_METHOD_NAME = getStableMangledNameForDescriptor(JsPlatform.INSTANCE.getBuiltIns().getComparable(), "compareTo");
public static final String NUMBER_RANGE = "NumberRange"; public static final String NUMBER_RANGE = "NumberRange";
public static final String CHAR_RANGE = "CharRange"; public static final String CHAR_RANGE = "CharRange";
public static final String LONG_FROM_NUMBER = "fromNumber"; public static final String LONG_FROM_NUMBER = "fromNumber";
@@ -243,7 +243,7 @@ public final class StaticContext {
public JsName apply(@NotNull DeclarationDescriptor descriptor) { public JsName apply(@NotNull DeclarationDescriptor descriptor) {
if (isDynamic(descriptor)) { if (isDynamic(descriptor)) {
String name = descriptor.getName().asString(); String name = descriptor.getName().asString();
return JsDynamicScope.INSTANCE$.declareName(name); return JsDynamicScope.INSTANCE.declareName(name);
} }
return null; return null;
@@ -159,7 +159,7 @@ public final class ExpressionVisitor extends TranslatorVisitor<JsNode> {
if (expressionInside != null) { if (expressionInside != null) {
return Translation.translateExpression(expressionInside, context); return Translation.translateExpression(expressionInside, context);
} }
return JsEmpty.INSTANCE$; return JsEmpty.INSTANCE;
} }
@Override @Override
@@ -191,7 +191,7 @@ public final class ExpressionVisitor extends TranslatorVisitor<JsNode> {
@Override @Override
@NotNull @NotNull
public JsNode visitCallableReferenceExpression(@NotNull KtCallableReferenceExpression expression, @NotNull TranslationContext context) { public JsNode visitCallableReferenceExpression(@NotNull KtCallableReferenceExpression expression, @NotNull TranslationContext context) {
return CallableReferenceTranslator.INSTANCE$.translate(expression, context); return CallableReferenceTranslator.INSTANCE.translate(expression, context);
} }
@Override @Override
@@ -63,7 +63,7 @@ public final class WhenTranslator extends AbstractTranslator {
private JsStatement translate() { private JsStatement translate() {
if (expressionToMatch != null && JsAstUtils.isEmptyExpression(expressionToMatch)) { if (expressionToMatch != null && JsAstUtils.isEmptyExpression(expressionToMatch)) {
return JsEmpty.INSTANCE$; return JsEmpty.INSTANCE;
} }
JsIf currentIf = null; JsIf currentIf = null;
@@ -232,6 +232,6 @@ public final class Translation {
} }
FunctionDescriptor functionDescriptor = getFunctionDescriptor(context.bindingContext(), mainFunction); FunctionDescriptor functionDescriptor = getFunctionDescriptor(context.bindingContext(), mainFunction);
JsArrayLiteral argument = new JsArrayLiteral(toStringLiteralList(arguments, context.program())); JsArrayLiteral argument = new JsArrayLiteral(toStringLiteralList(arguments, context.program()));
return CallTranslator.INSTANCE$.buildCall(context, functionDescriptor, Collections.singletonList(argument), null).makeStmt(); return CallTranslator.INSTANCE.buildCall(context, functionDescriptor, Collections.singletonList(argument), null).makeStmt();
} }
} }
@@ -40,13 +40,13 @@ public final class FunctionIntrinsics {
} }
private void registerFactories() { private void registerFactories() {
register(LongOperationFIF.INSTANCE$); register(LongOperationFIF.INSTANCE);
register(PrimitiveUnaryOperationFIF.INSTANCE); register(PrimitiveUnaryOperationFIF.INSTANCE);
register(PrimitiveBinaryOperationFIF.INSTANCE); register(PrimitiveBinaryOperationFIF.INSTANCE);
register(StringOperationFIF.INSTANCE); register(StringOperationFIF.INSTANCE);
register(ArrayFIF.INSTANCE); register(ArrayFIF.INSTANCE);
register(TopLevelFIF.INSTANCE); register(TopLevelFIF.INSTANCE);
register(NumberAndCharConversionFIF.INSTANCE$); register(NumberAndCharConversionFIF.INSTANCE);
register(ProgressionCompanionFIF.INSTANCE); register(ProgressionCompanionFIF.INSTANCE);
} }
@@ -200,7 +200,7 @@ public final class TopLevelFIF extends CompositeFIF {
} }
} }
String mangledName = getStableMangledNameForDescriptor(JsPlatform.INSTANCE$.getBuiltIns().getMutableMap(), operationName()); String mangledName = getStableMangledNameForDescriptor(JsPlatform.INSTANCE.getBuiltIns().getMutableMap(), operationName());
return new JsInvocation(new JsNameRef(mangledName, thisOrReceiver), arguments); return new JsInvocation(new JsNameRef(mangledName, thisOrReceiver), arguments);
} }
@@ -131,6 +131,6 @@ public final class CallExpressionTranslator extends AbstractCallExpressionTransl
assert currentScope instanceof JsFunctionScope : "Usage of js outside of function is unexpected"; assert currentScope instanceof JsFunctionScope : "Usage of js outside of function is unexpected";
JsScope temporaryRootScope = new JsRootScope(new JsProgram("<js code>")); JsScope temporaryRootScope = new JsRootScope(new JsProgram("<js code>"));
JsScope scope = new DelegatingJsFunctionScopeWithTemporaryParent((JsFunctionScope) currentScope, temporaryRootScope); JsScope scope = new DelegatingJsFunctionScopeWithTemporaryParent((JsFunctionScope) currentScope, temporaryRootScope);
return ParserUtilsKt.parse(jsCode, ThrowExceptionOnErrorReporter.INSTANCE$, scope); return ParserUtilsKt.parse(jsCode, ThrowExceptionOnErrorReporter.INSTANCE, scope);
} }
} }
@@ -63,13 +63,13 @@ public class VariableAccessTranslator extends AbstractTranslator implements Acce
@NotNull @NotNull
@Override @Override
public JsExpression translateAsGet() { public JsExpression translateAsGet() {
return CallTranslator.INSTANCE$.translateGet(context(), resolvedCall, receiver); return CallTranslator.INSTANCE.translateGet(context(), resolvedCall, receiver);
} }
@NotNull @NotNull
@Override @Override
public JsExpression translateAsSet(@NotNull JsExpression setTo) { public JsExpression translateAsSet(@NotNull JsExpression setTo) {
return CallTranslator.INSTANCE$.translateSet(context(), resolvedCall, setTo, receiver); return CallTranslator.INSTANCE.translateSet(context(), resolvedCall, setTo, receiver);
} }
@NotNull @NotNull
@@ -60,7 +60,7 @@ public final class JSTestGenerator {
@NotNull ClassDescriptor classDescriptor, @NotNull JSTester tester) { @NotNull ClassDescriptor classDescriptor, @NotNull JSTester tester) {
JsExpression expression = ReferenceTranslator.translateAsFQReference(classDescriptor, context); JsExpression expression = ReferenceTranslator.translateAsFQReference(classDescriptor, context);
JsNew testClass = new JsNew(expression); JsNew testClass = new JsNew(expression);
JsExpression functionToTestCall = CallTranslator.INSTANCE$.buildCall(context, functionDescriptor, JsExpression functionToTestCall = CallTranslator.INSTANCE.buildCall(context, functionDescriptor,
Collections.<JsExpression>emptyList(), testClass); Collections.<JsExpression>emptyList(), testClass);
JsStringLiteral testName = context.program().getStringLiteral(classDescriptor.getName() + "." + functionDescriptor.getName()); JsStringLiteral testName = context.program().getStringLiteral(classDescriptor.getName() + "." + functionDescriptor.getName());
tester.constructTestMethodInvocation(functionToTestCall, testName); tester.constructTestMethodInvocation(functionToTestCall, testName);