Skip to content

parser: invoke static delegate members accessed through a type - #26

Merged
rameel merged 1 commit into
mainfrom
parser/static-delegate-member
Nov 18, 2026
Merged

rameel merged 1 commit into
mainfrom
parser/static-delegate-member

Conversation

@rameel

@rameel rameel commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Invoking a static member of a delegate type through the name of its type, such as Formulas.Square(2) for a registered type with a static Func<int, int> Square, failed with Cannot access a member on a null reference, because the code expected the member to always have an instance.

This PR accesses the member without an instance, since a member bound through a type is static.

Invoking a static member of a delegate type through the name of its
type, such as 'Formulas.Square(2)' for a registered type with a static
Func<int, int> Square, failed with "Cannot access a member on a null
reference", because the code expected the member to always have an
instance.

Access the member without an instance, since a member bound through a
type is static.
@rameel
rameel merged commit 08ffcce into main Nov 18, 2026
1 check passed
@rameel
rameel deleted the parser/static-delegate-member branch November 18, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant