Accept empty parens in postfix recovery after undefineddef member (#41519)

Fixes #41519

Inside a generic body, c.Method() on a generic type parameter throws "Illegal expression" even though c.Method(1) compiles fine. The culprit is in recoverconsume_postfixops (pexpr.pas): when the postfix chain bails out on an undefineddef member, recovery swallows the trailing (...) but unconditionally calls comp_expr, which blows up on empty parens.

Just check for ) before parsing args. Tests in webtbs/tw41519 (should compile) and webtbf/tw41519 (specializing on a type without the member still fails, so we are not silencing real errors).

Merge request reports

Loading