Skip to content

Failed referential integrity test "Remove needless CLEAR", despite syntactically correct #315

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

Closed
matthewdjb opened this issue Jun 11, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@matthewdjb
Copy link

Error executing rule 'Remove needless CLEAR': Failed referential integrity test on command starting at source line 13!

It's a bit of a pathological example, so I must say that this occurred in a class that I didn't write and I'd never code in this way! I've managed to create a small example to demonstrate the issue.

`REPORT.

class lcl_main DEFINITION.
PUBLIC SECTION.
methods this_fails.
endclass.

CLASS lcl_main IMPLEMENTATION.

METHOD this_fails.
DATA: lo_ctrl TYPE REF TO lcl_main.
CREATE OBJECT lo_ctrl.
FREE: lo_ctrl. CLEAR: lo_ctrl. " <---- Line 13
ENDMETHOD.

ENDCLASS.`

@jmgrassau jmgrassau added the bug Something isn't working label Jun 11, 2024
@jmgrassau
Copy link
Member

Hi Matthew,

great, thanks for reporting this bug, I shall look into this! The example could even be shortened further, still triggering the bug:

  METHOD any_method.
    DATA lo_any TYPE REF TO lcl_any.
    FREE lo_any. CLEAR lo_any.
  ENDMETHOD.

Kind regards,
Jörg-Michael

@jmgrassau
Copy link
Member

Hi Matthew,

this bug will be fixed with the next release. Since the comment cannot be inserted on the same line between the two statements, the statements are moved to an own line:

image

Kind regards,
Jörg-Michael

@jmgrassau
Copy link
Member

Hi Matthew,

this bug should now be fixed with version 1.17.1, which was just released! Thanks again for reporting this.

Kind regards,
Jörg-Michael

@matthewdjb
Copy link
Author

Works fine now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants