BC36532: Nested function does not have a signature that is compatible with delegate '<delegatename>'
A lambda expression has been assigned to a delegate that has an incompatible signature. For example, in the following code, delegate Del
has two integer parameters.
Delegate Function Del(ByVal p As Integer, ByVal q As Integer) As Integer
The error is raised if a lambda expression with one argument is declared as type Del
:
' Neither of these is valid.
' Dim lambda1 As Del = Function(n As Integer) n + 1
' Dim lambda2 As Del = Function(n) n + 1
Error ID: BC36532
To correct this error
Adjust either the delegate definition or the assigned lambda expression so that the signatures are compatible.
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for