Skip to content

AddressOf does not wrap compatible signatures in lambdas anymore#1153

Merged
GrahamTheCoder merged 4 commits intoicsharpcode:masterfrom
gaschd:issue-1148-incompatible-delegate-signature
Nov 9, 2024
Merged

AddressOf does not wrap compatible signatures in lambdas anymore#1153
GrahamTheCoder merged 4 commits intoicsharpcode:masterfrom
gaschd:issue-1148-incompatible-delegate-signature

Conversation

@gaschd
Copy link
Copy Markdown
Contributor

@gaschd gaschd commented Nov 5, 2024

#1148

Problem

AddressOf delegates are wrapped in lambdas when delegate signatures are not equal but still compatible.
This behaviour is implemented correctly for base and derived classes but not for interfaces.

Solution

Using InheritsFromOrEquals overload with the option to include interfaces for delegates that widen the return type to an interface that is implemented by the type or narrow the input parameters types to classes implementing the interface.

@gaschd gaschd changed the title Issue 1148 incompatible delegate signature AddressOf does not wrap compatible signatures in lambdas anymore Nov 5, 2024
@GrahamTheCoder
Copy link
Copy Markdown
Member

Thanks for the PRs, will try to look on the weekend

@GrahamTheCoder GrahamTheCoder merged commit 6e0e0e9 into icsharpcode:master Nov 9, 2024
@gaschd gaschd deleted the issue-1148-incompatible-delegate-signature branch November 10, 2024 01:38
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.

2 participants