Converted ConstraintSystem to Kotlin

This commit is contained in:
Svetlana Isakova
2014-07-21 13:16:53 +04:00
parent 38d38e14c8
commit 578f6d4811
9 changed files with 390 additions and 641 deletions
@@ -428,8 +428,8 @@ public class Renderers {
Function<TypeBoundsImpl.Bound, String> renderBound = new Function<TypeBoundsImpl.Bound, String>() {
@Override
public String fun(TypeBoundsImpl.Bound bound) {
String arrow = bound.kind == LOWER_BOUND ? ">: " : bound.kind == UPPER_BOUND ? "<: " : ":= ";
return arrow + RENDER_TYPE.render(bound.type) + '(' + bound.position + ')';
String arrow = bound.getKind() == LOWER_BOUND ? ">: " : bound.getKind() == UPPER_BOUND ? "<: " : ":= ";
return arrow + RENDER_TYPE.render(bound.getConstrainingType()) + '(' + bound.getPosition() + ')';
}
};
Name typeVariableName = typeBounds.getTypeVariable().getName();
@@ -134,7 +134,7 @@ public class CallCompleter(
trace: BindingTrace
) {
fun updateSystemIfSuccessful(update: (ConstraintSystem) -> Boolean) {
val copy = getConstraintSystem()!!.copy()
val copy = (getConstraintSystem() as ConstraintSystemImpl).copy()
if (update(copy)) {
setConstraintSystem(copy)
}