Consider this Basic code: Option VBASupport 1 Sub foo End Function Function bar End Property This compiles and runs, even though the "End" clauses don't match respective start keywords. VBA doesn't allow that. This was implemented in i#109075 (https://bz.apache.org/ooo/show_bug.cgi?id=109075), to support constructs like Public Property Get Foo() ' Code... End Sub Yes, specifically 'Property Get' (but not 'Property Set', nor 'Property Let') allows closing it with 'End Sub' / 'End Function'; but no other variations are allowed. The code is in SbiParser::Parse (basic/source/comp/parser.cxx). This easyhack is only about closing a Sub / Function, not about closing Property Set/Let.
Alexandru Diaconu committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/047c84f431064d6bf5eeff536e6f554d4e63aac3 tdf#162983 Restrict closure of Function and Sub to only End Function and Sub. It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.