Static import
This commit is contained in:
+5
-4
@@ -38,6 +38,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import static org.jetbrains.jet.lang.resolve.java.TypeUsage.*;
|
import static org.jetbrains.jet.lang.resolve.java.TypeUsage.*;
|
||||||
|
import static org.jetbrains.jet.lang.types.Variance.*;
|
||||||
|
|
||||||
public class JavaTypeTransformer {
|
public class JavaTypeTransformer {
|
||||||
|
|
||||||
@@ -73,7 +74,7 @@ public class JavaTypeTransformer {
|
|||||||
if (!wildcardType.isBounded()) {
|
if (!wildcardType.isBounded()) {
|
||||||
return SubstitutionUtils.makeStarProjection(typeParameterDescriptor);
|
return SubstitutionUtils.makeStarProjection(typeParameterDescriptor);
|
||||||
}
|
}
|
||||||
Variance variance = wildcardType.isExtends() ? Variance.OUT_VARIANCE : Variance.IN_VARIANCE;
|
Variance variance = wildcardType.isExtends() ? OUT_VARIANCE : IN_VARIANCE;
|
||||||
|
|
||||||
PsiType bound = wildcardType.getBound();
|
PsiType bound = wildcardType.getBound();
|
||||||
assert bound != null;
|
assert bound != null;
|
||||||
@@ -198,7 +199,7 @@ public class JavaTypeTransformer {
|
|||||||
|
|
||||||
if (typeProjection.getProjectionKind() == typeParameterDescriptor.getVariance()) {
|
if (typeProjection.getProjectionKind() == typeParameterDescriptor.getVariance()) {
|
||||||
// remove redundant 'out' and 'in'
|
// remove redundant 'out' and 'in'
|
||||||
arguments.add(new TypeProjection(Variance.INVARIANT, typeProjection.getType()));
|
arguments.add(new TypeProjection(INVARIANT, typeProjection.getType()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
arguments.add(typeProjection);
|
arguments.add(typeProjection);
|
||||||
@@ -245,10 +246,10 @@ public class JavaTypeTransformer {
|
|||||||
private Variance arrayElementTypeProjectionKind(boolean vararg) {
|
private Variance arrayElementTypeProjectionKind(boolean vararg) {
|
||||||
Variance variance;
|
Variance variance;
|
||||||
if (howThisTypeIsUsed == MEMBER_SIGNATURE_CONTRAVARIANT && !vararg) {
|
if (howThisTypeIsUsed == MEMBER_SIGNATURE_CONTRAVARIANT && !vararg) {
|
||||||
variance = Variance.OUT_VARIANCE;
|
variance = OUT_VARIANCE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
variance = Variance.INVARIANT;
|
variance = INVARIANT;
|
||||||
}
|
}
|
||||||
return variance;
|
return variance;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user