abaplint icon indicating copy to clipboard operation
abaplint copied to clipboard

unused_variables - false negative?

Open DGRHicron opened this issue 10 months ago • 0 comments

Hello, I have this strange issue with abaplint. It doesn't recognize that my method of the class doesn't use parameters from interface method definition.

INTERFACE zcockpit_alv_factory
  PUBLIC.

  METHODS create_alv_purchases
    IMPORTING selection_params TYPE data
              repid            TYPE sy-repid OPTIONAL
              dataa            TYPE REF TO data
    RETURNING VALUE(result)    TYPE REF TO data.
ENDINTERFACE.


CLASS zcockpit_falv_factory DEFINITION
  PUBLIC
  CREATE PUBLIC.

  PUBLIC SECTION.
    INTERFACES zcockpit_alv_factory.

  PROTECTED SECTION.
  PRIVATE SECTION.
ENDCLASS.



CLASS zcockpit_falv_factory IMPLEMENTATION.
  METHOD zcockpit_alv_factory~create_alv_purchases.
    WRITE 'test'.
  ENDMETHOD.
ENDCLASS.

playground output

/zfoo.prog.abap[5, 15]: Variable "selection_params" not used(unused_variables)
/zfoo.prog.abap[6, 15]: Variable "repid" not used(unused_variables)
/zfoo.prog.abap[7, 15]: Variable "dataa" not used(unused_variables)

https://github.com/DGRHicron/abaplint_bugs - 0 issues.

DGRHicron avatar Feb 26 '25 11:02 DGRHicron