use of org.eclipse.xtext.xbase.typesystem.references.UnboundTypeReference in project xtext-xtend by eclipse.
the class DeferredTypeParameterHintCollectorTest method hasHintsFor.
public List<LightweightBoundTypeArgument> hasHintsFor(final Map<JvmTypeParameter, LightweightMergedBoundTypeArgument> mapping, final String typeParamName) {
final Set<JvmTypeParameter> allKeys = mapping.keySet();
for (final JvmTypeParameter key : allKeys) {
String _simpleName = key.getSimpleName();
boolean _equals = Objects.equal(_simpleName, typeParamName);
if (_equals) {
LightweightTypeReference _typeReference = mapping.get(key).getTypeReference();
final UnboundTypeReference unbound = ((UnboundTypeReference) _typeReference);
final Consumer<LightweightBoundTypeArgument> _function = (LightweightBoundTypeArgument it) -> {
Assert.assertEquals(BoundTypeArgumentSource.INFERRED_LATER, it.getSource());
};
unbound.getAllHints().forEach(_function);
return unbound.getAllHints();
}
}
StringConcatenation _builder = new StringConcatenation();
_builder.append("No mapping for ");
_builder.append(typeParamName);
_builder.append(" in ");
final Function1<JvmTypeParameter, String> _function_1 = (JvmTypeParameter it) -> {
return it.getSimpleName();
};
Iterable<String> _map = IterableExtensions.<JvmTypeParameter, String>map(mapping.keySet(), _function_1);
_builder.append(_map);
Assert.fail(_builder.toString());
return null;
}
use of org.eclipse.xtext.xbase.typesystem.references.UnboundTypeReference in project xtext-xtend by eclipse.
the class DeferredTypeParameterHintCollectorTest method hasNoHintsFor.
public void hasNoHintsFor(final Map<JvmTypeParameter, LightweightMergedBoundTypeArgument> mapping, final String typeParamName) {
final Set<JvmTypeParameter> allKeys = mapping.keySet();
for (final JvmTypeParameter key : allKeys) {
String _simpleName = key.getSimpleName();
boolean _equals = Objects.equal(_simpleName, typeParamName);
if (_equals) {
LightweightTypeReference _typeReference = mapping.get(key).getTypeReference();
final UnboundTypeReference unbound = ((UnboundTypeReference) _typeReference);
boolean _isEmpty = unbound.getAllHints().isEmpty();
boolean _not = (!_isEmpty);
if (_not) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("Unexpected mapping for ");
_builder.append(typeParamName);
_builder.append(" in ");
final Function1<JvmTypeParameter, String> _function = (JvmTypeParameter it) -> {
return it.getSimpleName();
};
Iterable<String> _map = IterableExtensions.<JvmTypeParameter, String>map(mapping.keySet(), _function);
_builder.append(_map);
Assert.fail(_builder.toString());
}
}
}
}
Aggregations