Private Sub SetStatusText(ByVal text As String)
If Me.InvokeRequired Then
Dim a As Action(Of String) = Function(s) SetStatusText(s) ' <---- ERROR
Me.Invoke(a, text)
Else
txtStatus.Text = text
End If
End Sub
ERROR : Expression does not produce a value.
Why that error what getting? I was testing a code and that part is lambda expression.
EDIT: Solved the above error by changing the Function
to Sub
.
==================================================================================
Public MustInherit Class Particle
Implements IComparable(Of Particle) ' <----- ERROR
'...
Public Function CompareTo(ByVal other As Particle) As Integer
If other Is Nothing Then
Throw New ArgumentNullException("other")
End If
If Me Is other OrElse Me.Cost = other.Cost Then
Return 0
End If
If Me.Cost > other.Cost Then
Return 1
Else
Return -1
End If
End Function
End Class
ERROR: Class 'Particle' must implement 'Function CompareTo(other As ParticleSwarm.Particle) As Integer' for interface 'System.IComparable(Of Particle)'
Here, Particle
and ParticleSwarm
are different classes. But why that error is appearing?