abaplint
abaplint copied to clipboard
Misleading "Expected ENDMETHOD" message
This message appears in places unrelated to the source of the error. I assume it's to do with the parser not finding the end of the method if there is an issue in the code.
Example, here shown at the CLASS ... DEFINITION:

Produced by following class linted as v702:
CLASS zcl_test DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS foo.
METHODS bar RETURNING VALUE(lv_result) TYPE abap_bool.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_test IMPLEMENTATION.
METHOD foo.
IF bar( ).
WRITE / 'Foo'.
ENDIF.
ENDMETHOD.
METHOD bar.
lv_result = abap_true.
ENDMETHOD.
ENDCLASS.
yea, need to rewrite the structure parser some day, #1975