secondIndex = firstIndex <= endIndex ? firstIndex + 1 : firstIndex - 1;
if (rec.getType().isList()) {
try {
IList list = (IList) rec.getValue();
IValue repl = __eval.__getValue().getValue();
if(!repl.getType().isList()){
throw new UnexpectedType(rec.getType(), repl.getType(), __eval.__getEval().getCurrentAST());
}
__eval.__setValue(__eval.newResult(list, __eval.__getValue()));
list = list.replace(firstIndex, secondIndex, endIndex, (IList) repl);
result = org.rascalmpl.interpreter.result.ResultFactory
.makeResult(rec.hasInferredType() ? rec.getType()
.lub(list.getType()) : rec.getType(), list,
__eval.__getEval());
} catch (IndexOutOfBoundsException e) { // include last in message
throw org.rascalmpl.interpreter.utils.RuntimeExceptionFactory
.indexOutOfBounds((IInteger) first.getValue(),
__eval.__getEval().getCurrentAST(), __eval