child.inferSlotType("localB", NUMBER_TYPE);
assertEquals(child, child.optimize());
}
public void testJoin1() {
FlowScope childA = localEntry.createChildFlowScope();
childA.inferSlotType("localB", NUMBER_TYPE);
FlowScope childAB = childA.createChildFlowScope();
childAB.inferSlotType("localB", STRING_TYPE);
FlowScope childB = localEntry.createChildFlowScope();
childB.inferSlotType("localB", BOOLEAN_TYPE);
assertTypeEquals(STRING_TYPE, childAB.getSlot("localB").getType());
assertTypeEquals(BOOLEAN_TYPE, childB.getSlot("localB").getType());
assertNull(childB.getSlot("localA").getType());
FlowScope joined = join(childB, childAB);
assertTypeEquals(createUnionType(STRING_TYPE, BOOLEAN_TYPE),
joined.getSlot("localB").getType());
assertNull(joined.getSlot("localA").getType());
joined = join(childAB, childB);
assertTypeEquals(createUnionType(STRING_TYPE, BOOLEAN_TYPE),
joined.getSlot("localB").getType());
assertNull(joined.getSlot("localA").getType());
assertEquals("Join should be symmetric",
join(childB, childAB), join(childAB, childB));
}