Make KotlinType.isError extension instead of member

This commit is contained in:
Alexander Udalov
2017-04-24 18:25:58 +03:00
parent 787a32f4f1
commit 38ea9986ab
71 changed files with 154 additions and 131 deletions
@@ -537,16 +537,10 @@ public class KotlinTypeCheckerTest extends KotlinTestWithEnvironment {
Project project = getProject();
KtExpression ktExpression = KtPsiFactoryKt.KtPsiFactory(project).createExpression(expression);
KotlinType type = expressionTypingServices.getType(scopeWithImports, ktExpression, TypeUtils.NO_EXPECTED_TYPE, DataFlowInfoFactory.EMPTY, KotlinTestUtils.DUMMY_TRACE);
assertNotNull(type);
assertTrue(type + " != " + expectedType, type.equals(expectedType));
}
private void assertErrorType(String expression) {
Project project = getProject();
KtExpression ktExpression = KtPsiFactoryKt.KtPsiFactory(project).createExpression(expression);
KotlinType type = expressionTypingServices.safeGetType(scopeWithImports, ktExpression, TypeUtils.NO_EXPECTED_TYPE, DataFlowInfoFactory.EMPTY, KotlinTestUtils.DUMMY_TRACE);
assertTrue("Error type expected but " + type + " returned", type.isError());
}
private void assertType(String contextType, String expression, String expectedType) {
KotlinType thisType = makeType(contextType);
ReceiverParameterDescriptorImpl receiverParameterDescriptor = new ReceiverParameterDescriptorImpl(