use of org.eclipse.xtend.core.tests.typesystem.SimpleUnboundTypeReference in project xtext-xtend by eclipse.
the class MockTypeParameterSubstitutor method doVisitParameterizedTypeReference.
@Override
public LightweightTypeReference doVisitParameterizedTypeReference(final ParameterizedTypeReference reference, final Set<JvmTypeParameter> visiting) {
final JvmType type = reference.getType();
if ((type instanceof JvmTypeParameter)) {
boolean _add = visiting.add(((JvmTypeParameter) type));
boolean _not = (!_add);
if (_not) {
return null;
}
try {
final LightweightMergedBoundTypeArgument mappedReference = this.getTypeParameterMapping().get(type);
if ((mappedReference != null)) {
return mappedReference.getTypeReference().<Set<JvmTypeParameter>, LightweightTypeReference>accept(this, visiting);
} else {
ITypeReferenceOwner _owner = this.getOwner();
Object _object = new Object();
final SimpleUnboundTypeReference result = new SimpleUnboundTypeReference(_owner, ((JvmTypeParameter) type), _object);
Map<JvmTypeParameter, LightweightMergedBoundTypeArgument> _typeParameterMapping = this.getTypeParameterMapping();
LightweightMergedBoundTypeArgument _lightweightMergedBoundTypeArgument = new LightweightMergedBoundTypeArgument(result, VarianceInfo.INVARIANT);
_typeParameterMapping.put(((JvmTypeParameter) type), _lightweightMergedBoundTypeArgument);
return result;
}
} finally {
visiting.remove(type);
}
}
return super.doVisitParameterizedTypeReference(reference, visiting);
}
Aggregations