I had a typo in my code and added a delegate where an Event
should be used:
public Action AfterItemSelectionCallback;
The class that's using the supposed event contains:
this.folderListViewModel.AfterItemSelectionCallback += this.HandleItemSelection;
and later on removes the handler:
this.folderListViewModel.AfterItemSelectionCallback -= this.HandleItemSelection;
This builds and runs fine without errors or warnings.
Enter Jetbrains Resharper 8.1. I installed a trial of Resharper and it complains that
"Delegate subtraction has unpredictable result."
- Why would += be okay if -= is not?
- Why does the compiler not complain if this is actually a problem?