transpiler icon indicating copy to clipboard operation
transpiler copied to clipboard

the casting addition of assign statement is ignored

Open arcanist123 opened this issue 4 years ago • 3 comments

in the following code adding or removing the keyword "CASTING" is not changing the result of transpilation. It should either throw the exception not implemented or somehow affect the js code

  TYPES:
    tv_char_4 TYPE c LENGTH 5,

    BEGIN OF ts_test,
      a TYPE tv_char_4,
    END OF ts_test.
  DATA ls_test TYPE ts_test.


  FIELD-SYMBOLS <lv> TYPE tv_char_4.
  ASSIGN COMPONENT 'A' OF STRUCTURE ls_test TO <lv> CASTING.
  WRITE <lv>.

arcanist123 avatar May 23 '21 08:05 arcanist123

UT fails since field-symbols don't support type casting: https://github.com/abapGit/abapGit/pull/5611

mbtools avatar Jun 04 '22 18:06 mbtools

For the top test case, I dont think there is any difference, as the source and target types are the same, so CASTING is not needed?

some CASTING implemented in https://github.com/abaplint/transpiler/pull/476

larshp avatar Jun 05 '22 04:06 larshp

https://github.com/abaplint/transpiler/pull/747/commits/bb3c1e74f157f3bc26526d24e2a888c5e6d51b57

fixes when using hex values wrongly

larshp avatar Jun 05 '22 05:06 larshp