79487570

Date: 2025-03-05 20:11:18
Score: 1.5
Natty:
Report link

To fix this I had to use a "Upper Bounded Wildcard" on the parameter of the function which fixed the typing issue. So instead of

public void bar(List<Parent> parents) {
  parents.stream.forEach(parent::foo);
}

We changed it to

public void bar(List<? extends Parent> parents) {
  parents.stream.forEach(parent::foo);
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: ben8622