use of org.eclipse.xtext.common.types.JvmVoid in project xtext-eclipse by eclipse.
the class JdtTypeProviderTest method testBug300216.
@Test
public void testBug300216() {
JvmDeclaredType type = (JvmDeclaredType) getTypeProvider().findTypeByName("java.lang.Object");
assertTrue(type.getSuperTypes().isEmpty());
URI unresolveableType = URI.createURI("java:/Objects/Something#Something");
JvmVoid proxy = TypesFactory.eINSTANCE.createJvmVoid();
JvmParameterizedTypeReference typeReference = TypesFactory.eINSTANCE.createJvmParameterizedTypeReference();
typeReference.setType(proxy);
((InternalEObject) proxy).eSetProxyURI(unresolveableType);
type.getSuperTypes().add(typeReference);
assertTrue(type.getSuperTypes().get(0).getType().eIsProxy());
assertEquals(2, type.eResource().getResourceSet().getResources().size());
}
use of org.eclipse.xtext.common.types.JvmVoid in project xtext-eclipse by eclipse.
the class AbstractConstructorScopeTest method testGetElementByInstance_02.
@Test
public void testGetElementByInstance_02() {
JvmVoid voidType = TypesFactory.eINSTANCE.createJvmVoid();
IEObjectDescription element = getConstructorScope().getSingleElement(voidType);
assertNull(element);
}
use of org.eclipse.xtext.common.types.JvmVoid in project xtext-eclipse by eclipse.
the class AbstractTypeScopeTest method testGetElementByInstance_01.
@Test
public void testGetElementByInstance_01() {
JvmVoid voidType = TypesFactory.eINSTANCE.createJvmVoid();
IEObjectDescription element = getTypeScope().getSingleElement(voidType);
assertNotNull(element);
assertEquals(voidType.getIdentifier(), element.getName().toString());
}
use of org.eclipse.xtext.common.types.JvmVoid in project xtext-xtend by eclipse.
the class LinkingErrorTest method testNoException_02.
@Test
public void testNoException_02() throws Exception {
XtendFunction function = function("def noException() {\n" + // exception case is i
" val closure = [ i| return i]\n" + " for (x : 1..100) closure.apply(x)\n" + " }");
JvmTypeReference type = associations.getDirectlyInferredOperation(function).getReturnType();
assertTrue(type.getType() instanceof JvmVoid);
assertFalse(type.getType().eIsProxy());
assertNoExceptions(function);
}
use of org.eclipse.xtext.common.types.JvmVoid in project xtext-xtend by eclipse.
the class LinkingErrorTest method testNoException_01.
@Test
public void testNoException_01() throws Exception {
XtendFunction function = function("def noException() {\n" + // exception case is Integeri
" val closure = [Integeri| return i]\n" + " for (x : 1..100) closure.apply(x)\n" + " }");
JvmTypeReference type = associations.getDirectlyInferredOperation(function).getReturnType();
assertTrue(type.getType() instanceof JvmVoid);
assertFalse(type.getType().eIsProxy());
assertNoExceptions(function);
}
Aggregations