Fix compiler warnings in compiler code

This commit is contained in:
Alexander Udalov
2020-08-14 12:55:43 +02:00
parent 9b94e073af
commit a21f273570
84 changed files with 149 additions and 141 deletions
@@ -173,7 +173,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
return null;
}
static class BlockStackElement {
public static class BlockStackElement {
}
static class LoopBlockStackElement extends BlockStackElement {
@@ -2224,8 +2224,9 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
if (!skipPropertyAccessors) {
if (isBackingFieldMovedFromCompanion && context.getContextDescriptor() instanceof AccessorForPropertyBackingField) {
propertyDescriptor = (PropertyDescriptor) backingFieldContext.getParentContext()
.getAccessor(propertyDescriptor, AccessorKind.IN_CLASS_COMPANION, delegateType, superCallTarget);
CodegenContext<?> parentContext = backingFieldContext.getParentContext();
propertyDescriptor =
parentContext.getAccessor(propertyDescriptor, AccessorKind.IN_CLASS_COMPANION, delegateType, superCallTarget);
}
else {
propertyDescriptor =
@@ -1543,7 +1543,7 @@ public abstract class StackValue {
//TODO: try to don't generate defaults at all in CollectionElementReceiver
List<ResolvedValueArgument> getterArguments = new ArrayList(collectionElementReceiver.valueArguments);
List<ResolvedValueArgument> getterArguments = new ArrayList<>(collectionElementReceiver.valueArguments);
List<ResolvedValueArgument> getterDefaults = CollectionsKt.takeLastWhile(getterArguments,
argument -> argument instanceof DefaultValueArgument);
@@ -171,7 +171,7 @@ public class InternalFinallyBlockInliner extends CoveringTryCatchNodeProcessor {
checkClusterInvariant(clustersFromInnermost);
int originalDepthIndex = 0;
List<TryCatchBlockNodeInfo> nestedUnsplitBlocksWithoutFinally = new ArrayList();
List<TryCatchBlockNodeInfo> nestedUnsplitBlocksWithoutFinally = new ArrayList<>();
while (tryCatchBlockIterator.hasNext()) {
TryBlockCluster<TryCatchBlockNodeInfo> clusterToFindFinally = tryCatchBlockIterator.next();
List<TryCatchBlockNodeInfo> clusterBlocks = clusterToFindFinally.getBlocks();
@@ -35,7 +35,7 @@ private class State<T>(val path: MutableList<String>) {
path.add(step)
}
fun removeStep(step: String) {
fun removeStep() {
path.removeAt(path.lastIndex)
}
@@ -93,7 +93,7 @@ abstract class TypeAnnotationCollector<T>(val context: TypeSystemCommonBackendCo
fun KotlinTypeMarker.process(step: String) {
state.addStep(step)
this.gatherTypeAnnotations()
state.removeStep(step)
state.removeStep()
}