abaplint icon indicating copy to clipboard operation
abaplint copied to clipboard

Misleading "Expected ENDMETHOD" message

Open pokrakam opened this issue 3 years ago • 1 comments

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: image

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.

pokrakam avatar Nov 30 '21 07:11 pokrakam

yea, need to rewrite the structure parser some day, #1975

larshp avatar Nov 30 '21 07:11 larshp