Skip to content

open-abap fails when calling method of unbound reference instead of throwing an error #926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
oblomov-dev opened this issue Feb 4, 2025 · 2 comments

Comments

@oblomov-dev
Copy link
Contributor

oblomov-dev commented Feb 4, 2025

open abap breaks when running unit test for this PR:
abap2UI5/abap2UI5#1739

Expect an exception but open-abap just fails instead of throwing an error:
https://github.com/abap2UI5/abap2UI5/blob/open-abap-bug/src/01/02/z2ui5_cl_core_srv_json.clas.testclasses.abap#L62-L69

Image Image

Let me know if there is anything i can do on my side.

@oblomov-dev
Copy link
Contributor Author

closing the PR but here is the snippet:

CLASS ltcl_test DEFINITION FINAL
  FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.

  PRIVATE SECTION.
    METHODS test FOR TESTING RAISING cx_static_check.

ENDCLASS.

CLASS ltcl_test IMPLEMENTATION.

  METHOD test.

    TRY.
        DATA lo_test TYPE REF TO ltcl_test.
        lo_test->test( ).
        cl_abap_unit_assert=>abort( ).

      CATCH cx_root.
        "exception is expected when lo_test is not bound
    ENDTRY.

  ENDMETHOD.

ENDCLASS.

@larshp
Copy link
Member

larshp commented Feb 9, 2025

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants