Test for infix resolve
This commit is contained in:
@@ -166,8 +166,18 @@ public class ExpectedResolveData {
|
||||
assertNotNull(declarationPosition);
|
||||
JetDeclaration declaration = getAncestorOfType(JetDeclaration.class, declElement);
|
||||
assertNotNull(declaration);
|
||||
ClassDescriptor classDescriptor = bindingContext.getClassDescriptor((JetClass) declaration);
|
||||
expectedTypeConstructor = classDescriptor.getTypeConstructor();
|
||||
if (declaration instanceof JetClass) {
|
||||
ClassDescriptor classDescriptor = bindingContext.getClassDescriptor((JetClass) declaration);
|
||||
expectedTypeConstructor = classDescriptor.getTypeConstructor();
|
||||
}
|
||||
else if (declaration instanceof JetTypeParameter) {
|
||||
TypeParameterDescriptor typeParameterDescriptor = bindingContext.getTypeParameterDescriptor((JetTypeParameter) declaration);
|
||||
expectedTypeConstructor = typeParameterDescriptor.getTypeConstructor();
|
||||
}
|
||||
else {
|
||||
fail("Unsupported declaration: " + declaration);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
assertSame("At " + position + ": ", expectedTypeConstructor, expressionType.getConstructor());
|
||||
|
||||
@@ -126,4 +126,8 @@ public class JetResolveTest extends ExtensibleResolveTestCase {
|
||||
doTest("/resolve/ResolveToJava.jet", true, true);
|
||||
}
|
||||
|
||||
public void testResolveOfInfixExpressions() throws Exception {
|
||||
doTest("/resolve/ResolveOfInfixExpressions.jet", true, true);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user