Use Unit instead of Void
This commit is contained in:
committed by
Alexander Udalov
parent
2e585f88a3
commit
00c3156b59
+4
-3
@@ -23,6 +23,7 @@ import com.google.common.collect.Lists;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import jet.Function0;
|
||||
import jet.Function1;
|
||||
import jet.Unit;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
@@ -401,11 +402,11 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyDesc
|
||||
return Collections.emptyList();
|
||||
}
|
||||
},
|
||||
new Function1<Collection<JetType>, Void>() {
|
||||
new Function1<Collection<JetType>, Unit>() {
|
||||
@Override
|
||||
public Void invoke(@NotNull Collection<JetType> supertypes) {
|
||||
public Unit invoke(@NotNull Collection<JetType> supertypes) {
|
||||
findAndDisconnectLoopsInTypeHierarchy(supertypes);
|
||||
return null;
|
||||
return Unit.VALUE;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.jetbrains.jet.storage;
|
||||
|
||||
import jet.Function0;
|
||||
import jet.Function1;
|
||||
import jet.Unit;
|
||||
import junit.framework.TestCase;
|
||||
import org.jetbrains.jet.util.ReenteringLazyValueComputationException;
|
||||
|
||||
@@ -238,10 +239,10 @@ public class StorageManagerTest extends TestCase {
|
||||
}
|
||||
},
|
||||
null,
|
||||
new Function1<String, Void>() {
|
||||
new Function1<String, Unit>() {
|
||||
@Override
|
||||
public Void invoke(String s) {
|
||||
return null;
|
||||
public Unit invoke(String s) {
|
||||
return Unit.VALUE;
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -272,12 +273,12 @@ public class StorageManagerTest extends TestCase {
|
||||
return "tolerant";
|
||||
}
|
||||
},
|
||||
new Function1<String, Void>() {
|
||||
new Function1<String, Unit>() {
|
||||
@Override
|
||||
public Void invoke(String s) {
|
||||
public Unit invoke(String s) {
|
||||
counter.inc();
|
||||
assertEquals("tolerant", s);
|
||||
return null;
|
||||
return Unit.VALUE;
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -301,12 +302,12 @@ public class StorageManagerTest extends TestCase {
|
||||
}
|
||||
},
|
||||
null,
|
||||
new Function1<Collection<String>, Void>() {
|
||||
new Function1<Collection<String>, Unit>() {
|
||||
@Override
|
||||
public Void invoke(Collection<String> strings) {
|
||||
public Unit invoke(Collection<String> strings) {
|
||||
counter.inc();
|
||||
strings.add("postComputed");
|
||||
return null;
|
||||
return Unit.VALUE;
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -327,12 +328,12 @@ public class StorageManagerTest extends TestCase {
|
||||
return strings;
|
||||
}
|
||||
},
|
||||
new Function1<Collection<String>, Void>() {
|
||||
new Function1<Collection<String>, Unit>() {
|
||||
@Override
|
||||
public Void invoke(Collection<String> strings) {
|
||||
public Unit invoke(Collection<String> strings) {
|
||||
counter.inc();
|
||||
strings.add("postComputed");
|
||||
return null;
|
||||
return Unit.VALUE;
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -361,11 +362,11 @@ public class StorageManagerTest extends TestCase {
|
||||
return "second";
|
||||
}
|
||||
},
|
||||
new Function1<String, Void>() {
|
||||
new Function1<String, Unit>() {
|
||||
@Override
|
||||
public Void invoke(String s) {
|
||||
public Unit invoke(String s) {
|
||||
fail("Recursion-tolerating value should not be post computed");
|
||||
return null;
|
||||
return Unit.VALUE;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user