#Cannot infer type arguments for ArrayList<>

1 messages · Page 1 of 1 (latest)

winter copperBOT
#

<@&987246399047479336> please have a look, thanks.

vital edge
#

In the line PlayerType players = new ArrayList<>() there are a couple of errors... and you're seeing only the first

  • The <> (diamond operator) can't infer the generic parameters from the target-type PlayerType because no generic parameters are supplied (assuming PlayerType is even a generic class)
  • ArrayList can't be assigned to a reference field of type PlayerType because ArrayList is not a subclass of PlayerType (or implementing that interface if PlayerType is an interface).
#

Is players supposed to be a List of PlayerType (rather than a single PlayerType?

mint jungle
#

@neon jolt ↑