Support calling conventions on anonymous / reference-to-function types#343
Open
civilian7 wants to merge 1 commit into
Open
Support calling conventions on anonymous / reference-to-function types#343civilian7 wants to merge 1 commit into
civilian7 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AnonymousMethod/AnonymousMethodTypedid not consume a trailing calling-convention directive after the result type. The Delphi RTL uses this onreference to functiontypes and inline anonymous methods:Winapi.EdgeUtils.pas:TCb<T> = reference to function(const P1: T): HResult stdcall;Vcl.Edge.pas: inlinefunction(...): HResult stdcall begin ... end;These currently fail with
SemiColon/Begin expected found stdcall.Change
Both
AnonymousMethodandAnonymousMethodTypenow consume trailing calling-convention directives (cdecl/pascal/register/safecall/stdcall) via the existingProceduralDirectiverule.Test
Added
Test/Snippets/anonymousmethodcallingconvention.pasexercisingreference to function(...): HRESULT stdcallandreference to procedure(...) cdecl.Verified by parsing the full Delphi 13.1 RTL/VCL source:
Winapi.EdgeUtils,Vcl.Edge, andFMX.WebBrowser.Winnow parse cleanly (no new regressions across the 2455-unit corpus).