}
if(!(expectedArgType instanceof AtomicType)) {
throw new TypeError("expectedArgType must be built-in atomic type, but was "
+ expectedArgType);
}
final AtomicType expected = (AtomicType) expectedArgType;
final ValueSequence res = new ValueSequence(dynEnv);
final IFocus<? extends Item> atomizedItor = argv.atomize(dynEnv).iterator();
for(Item it : atomizedItor) {
final Type actualType = it.getType();
// apply fs:ConvertSimpleOperand
if(actualType == UntypedAtomicType.UNTYPED_ATOMIC && expected.getTypeId() >= 0) {
final AtomicValue casted = ((AtomicValue) it).castAs(expected, dynEnv);
res.addItem(casted);
} else {
res.addItem(it);
}