this post was submitted on 10 Oct 2024
130 points (95.1% liked)

Programmer Humor

19652 readers
2086 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 1 month ago

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.

Link: https://pl.kotl.in/pIt-uHw7d