throw new UnexpectedType(TypeFactory.getInstance().integerType(), key.getType(), ctx.getCurrentAST());
}
if (getValue().length() == 0) {
throw RuntimeExceptionFactory.emptyList(ctx.getCurrentAST(), ctx.getStackTrace());
}
IInteger index = ((IInteger)key.getValue());
int idx = index.intValue();
if(idx < 0){
idx = idx + getValue().length();
}
if ( (idx >= getValue().length()) || (idx < 0) ) {
throw RuntimeExceptionFactory.indexOutOfBounds(index, ctx.getCurrentAST(), ctx.getStackTrace());