shift in byte mode should produce runtime error for dynamic type
This should not be possible to transpile - the lv_temp type should not allow shift in byte mode Probably a runtime check would also be required - the field symbol of type any that is pointing to invalid type should produce a runtime error instead
DATA lv_temp TYPE string.
lv_temp = 'abc'.
SHIFT lv_temp BY 1 PLACES LEFT in byte mode.
WRITE lv_temp.
a few notes on syntax errors:
it is the responsibility of abaplint to ensure the syntax is correct, there is also a lot of work to be done here
the transpiler takes the AST, and assumes its correct ABAP syntax and does it best to transpile it
I've added the "abaplint" label to the issues which I guess should be fixed in abaplint
Agreed. I opened a separate issue in abaplint repository. This code should fail with runtime error instead of executing without any issue
DATA lv_temp TYPE string.
lv_temp = 'abc'.
FIELD-SYMBOLS <lv> TYPE any.
ASSIGN lv_temp TO <lv>.
SHIFT <lv> BY 1 PLACES LEFT IN BYTE MODE.
WRITE lv_temp.
runtime error = OBJECTS_NOT_BYTELIKE