use of javax.lang.model.type.TypeVariable in project buck by facebook.
the class StandaloneTypeVariableTest method testGetLowerBoundMultipleBounds.
@Test
public void testGetLowerBoundMultipleBounds() throws IOException {
compile("class Foo<T extends java.lang.Runnable & java.lang.CharSequence> { }");
TypeVariable tVar = (TypeVariable) elements.getTypeElement("Foo").getTypeParameters().get(0).asType();
assertSameType(types.getNullType(), tVar.getLowerBound());
}
use of javax.lang.model.type.TypeVariable in project buck by facebook.
the class StandaloneTypeVariableTest method testToStringMultipleBounds.
@Test
public void testToStringMultipleBounds() throws IOException {
compile("class Foo<T extends java.lang.CharSequence & java.lang.Runnable> { }");
TypeVariable typeVariable = (TypeVariable) elements.getTypeElement("Foo").getTypeParameters().get(0).asType();
assertEquals("T", typeVariable.toString());
}
use of javax.lang.model.type.TypeVariable in project buck by facebook.
the class StandaloneTypeVariableTest method testToStringUnbounded.
@Test
public void testToStringUnbounded() throws IOException {
compile("class Foo<T> { }");
TypeVariable typeVariable = (TypeVariable) elements.getTypeElement("Foo").getTypeParameters().get(0).asType();
assertEquals("T", typeVariable.toString());
}
use of javax.lang.model.type.TypeVariable in project buck by facebook.
the class StandaloneTypeVariableTest method testGetLowerBoundUnbounded.
@Test
public void testGetLowerBoundUnbounded() throws IOException {
compile("class Foo<T> { }");
TypeVariable tVar = (TypeVariable) elements.getTypeElement("Foo").getTypeParameters().get(0).asType();
assertSameType(types.getNullType(), tVar.getLowerBound());
}
use of javax.lang.model.type.TypeVariable in project buck by facebook.
the class StandaloneTypeVariableTest method testToStringBounded.
@Test
public void testToStringBounded() throws IOException {
compile("class Foo<T extends java.lang.CharSequence> { }");
TypeVariable typeVariable = (TypeVariable) elements.getTypeElement("Foo").getTypeParameters().get(0).asType();
assertEquals("T", typeVariable.toString());
}
Aggregations