org.eclipse.xtext.xbase.typesystem.util.VarianceInfo Java Examples

The following examples show how to use org.eclipse.xtext.xbase.typesystem.util.VarianceInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testBug470766_01() {
  boolean _isJava12OrLater = AbstractXtendTestCase.isJava12OrLater();
  if (_isJava12OrLater) {
    Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("void", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
    Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("Integer", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
    Pair<String, VarianceInfo> _mappedTo_4 = Pair.<String, VarianceInfo>of("Long", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_5 = this.operator_mappedTo(_mappedTo_4, VarianceInfo.INVARIANT);
    this.to(this.merge(_mappedTo_1, _mappedTo_3, _mappedTo_5), "Number & Comparable<?> & Constable & ConstantDesc", VarianceInfo.INVARIANT);
  } else {
    Pair<String, VarianceInfo> _mappedTo_6 = Pair.<String, VarianceInfo>of("void", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_7 = this.operator_mappedTo(_mappedTo_6, VarianceInfo.INVARIANT);
    Pair<String, VarianceInfo> _mappedTo_8 = Pair.<String, VarianceInfo>of("Integer", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_9 = this.operator_mappedTo(_mappedTo_8, VarianceInfo.INVARIANT);
    Pair<String, VarianceInfo> _mappedTo_10 = Pair.<String, VarianceInfo>of("Long", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_11 = this.operator_mappedTo(_mappedTo_10, VarianceInfo.INVARIANT);
    this.to(this.merge(_mappedTo_7, _mappedTo_9, _mappedTo_11), "Number & Comparable<?>", VarianceInfo.INVARIANT);
  }
}
 
Example #2
Source File: UnboundTypeReference.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
protected boolean canResolveTo(LightweightTypeReference reference, List<LightweightBoundTypeArgument> allHints) {
	List<LightweightBoundTypeArgument> inferredHints = Lists.newArrayListWithCapacity(allHints.size());
	List<LightweightBoundTypeArgument> effectiveHints = Lists.newArrayListWithCapacity(allHints.size());
	EnumSet<VarianceInfo> varianceHints = EnumSet.noneOf(VarianceInfo.class);
	for(LightweightBoundTypeArgument hint: allHints) {
		if (hint.getOrigin() instanceof VarianceInfo) {
			varianceHints.add((VarianceInfo) hint.getOrigin());
		} else {
			effectiveHints.add(hint);
			if (hint.getSource() == BoundTypeArgumentSource.INFERRED) {
				inferredHints.add(hint);
			}
		}
	}
	if (effectiveHints.isEmpty())
		return false;
	boolean result = getServices().getBoundTypeArgumentMerger().isPossibleMergeResult(!inferredHints.isEmpty() ? inferredHints : effectiveHints, reference);
	return result;
}
 
Example #3
Source File: RawTypeConformanceComputer.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
protected int doIsConformant(LightweightTypeReference left, UnboundTypeReference right, int flags) {
	if (left.getType() == right.getType() || left.isType(Object.class)) {
		return flags | SUCCESS;
	}
	if ((flags & ALLOW_UNBOXING) == 0 && left.isPrimitive()) {
		return flags;
	}
	boolean doesNotHaveSignificantHints = false;
	if (((flags & RAW_TYPE) == 0) && (right.canResolveTo(left) || (flags & AS_TYPE_ARGUMENT) != 0 && (doesNotHaveSignificantHints = !right.hasSignificantHints()))) {
		if ((flags & UNBOUND_COMPUTATION_ADDS_HINTS) != 0 && doesNotHaveSignificantHints) {
			right.acceptHint(left, BoundTypeArgumentSource.INFERRED_LATER, left, VarianceInfo.INVARIANT, VarianceInfo.INVARIANT);
		}
		return flags | SUCCESS;
	}
	right.tryResolve(false);
	LightweightTypeReference resolvedTo = right.getResolvedTo();
	if (resolvedTo != null) {
		return doIsConformant(left, resolvedTo, flags);
	}
	return flags;
}
 
Example #4
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_01_a() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", VarianceInfo.INVARIANT);
}
 
Example #5
Source File: ActualTypeArgumentCollectorTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testUnambiguousMapping_05() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T, T2", "T", "CharSequence", "T2", "CharSequence");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("CharSequence", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _assertMapping = this.assertMapping(_mappedBy, "T", _mappedTo_1);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("CharSequence", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.assertMapping(_assertMapping, "T2", _mappedTo_3);
}
 
Example #6
Source File: ActualTypeArgumentCollectorTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testUpperBound_09() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T", "Iterable<? extends Iterable<T>>", "Iterable<? extends Iterable<CharSequence>>");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("CharSequence", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1);
}
 
Example #7
Source File: ActualTypeArgumentCollectorTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testBestEffortMapping_04() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T", "java.util.HashMap<java.util.ArrayList<T>, java.util.ArrayList<T>>", "java.util.Map<Iterable<String>, java.util.HashSet<Integer>>");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("Integer", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1, _mappedTo_3);
}
 
Example #8
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_09_h() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.IN);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example #9
Source File: ActualTypeArgumentCollectorTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testBestEffortMapping_02() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T", "java.util.ArrayList<T>", "java.util.HashSet<String>");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1);
}
 
Example #10
Source File: ActualTypeArgumentCollectorTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testCircularTypeParams_10() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T extends Iterable<T>, T2 extends Iterable<T>", "CharSequence", "String");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("Iterable<Object>", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _assertMapping = this.assertMapping(_mappedBy, "T", _mappedTo_1);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("Iterable<Iterable<Object>>", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.assertMapping(_assertMapping, "T2", _mappedTo_3);
}
 
Example #11
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_06_c() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.IN);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example #12
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_07_b() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example #13
Source File: ActualTypeArgumentCollectorTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testLowerBound_04() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T, T2 extends T", "Iterable<? super T>", "Iterable<? extends String>");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _assertMapping = this.assertMapping(_mappedBy, "T", _mappedTo_1);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.assertMapping(_assertMapping, "T2", _mappedTo_3);
}
 
Example #14
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testNothingToMerge_03() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  this.to(this.merge(_mappedTo_1), "String", VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.to(this.merge(_mappedTo_3), "String", VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_4 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_5 = this.operator_mappedTo(_mappedTo_4, VarianceInfo.IN);
  this.to(this.merge(_mappedTo_5), "String", null);
}
 
Example #15
Source File: ActualTypeArgumentCollectorTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testUnambiguousMapping_04() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T", "T", "CharSequence", "T", "CharSequence");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("CharSequence", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("CharSequence", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1, _mappedTo_3);
}
 
Example #16
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_07_f() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.IN);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", VarianceInfo.INVARIANT);
}
 
Example #17
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_01_b() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example #18
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_05_f() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.IN);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", VarianceInfo.OUT);
}
 
Example #19
Source File: ActualTypeArgumentCollectorTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testDependentTypeParams_04() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T, T2 extends T, T3 extends T2", "java.util.Map<T, T3>", "java.util.Map<String, Integer>");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _assertMapping = this.assertMapping(_mappedBy, "T", _mappedTo_1);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _assertMapping_1 = this.assertMapping(_assertMapping, "T2", _mappedTo_3);
  Pair<String, VarianceInfo> _mappedTo_4 = Pair.<String, VarianceInfo>of("Integer", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_5 = this.operator_mappedTo(_mappedTo_4, VarianceInfo.INVARIANT);
  this.assertMapping(_assertMapping_1, "T3", _mappedTo_5);
}
 
Example #20
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_01_e() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example #21
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_01_f() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.IN);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example #22
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_01_h() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.IN);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example #23
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_09_d() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example #24
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_06_g() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.IN);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example #25
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_02_b() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example #26
Source File: ActualTypeArgumentMergeTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testUpperBound_11() {
  boolean _isJava12OrLater = AbstractXtendTestCase.isJava12OrLater();
  if (_isJava12OrLater) {
    this.to(this.merge(this.mappedBy("T", "java.util.Map<? extends T, ? extends T>", "java.util.Map<String, Integer>"), "T"), "Comparable<?> & Constable & ConstantDesc & Serializable", VarianceInfo.INVARIANT);
  } else {
    this.to(this.merge(this.mappedBy("T", "java.util.Map<? extends T, ? extends T>", "java.util.Map<String, Integer>"), "T"), "Comparable<?> & Serializable", VarianceInfo.INVARIANT);
  }
}
 
Example #27
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_02_d() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", VarianceInfo.INVARIANT);
}
 
Example #28
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_02_f() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.IN);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", VarianceInfo.IN);
}
 
Example #29
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_07_g() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.IN);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example #30
Source File: BoundTypeArgumentMergerTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testArgumentTypeUsedTwice_02_h() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.IN);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}