It was about 3 years ago, and I haven't been able to find my old code again. I probably discarded it after finding out it didn't work well. I was able to find this screenshot though:
Uh. Probably not exactly your case, but I managed to "reproduce" them.
The first case is easy if you just override the setter of a property, and is more a feature of the language rather than a bug.
The second case is more tricky, but by using a generic delegate you can manage to trick it by doing an unchecked cast. Got the same warning in IntelliJ as well.