vjurenka / BWMirror

BWMirror API source files
Other
55 stars 13 forks source link

Types are not final #16

Closed heinermann closed 8 years ago

heinermann commented 9 years ago

i.e. in Scala:

  def buildSupplyWith(unit: BWUnit) = {
    val supplyProvider = unit.getRace.getSupplyProvider
    unit.getRace match {
      case Race.Zerg => unit.train(supplyProvider)
      case _ => unit.build(supplyProvider, game.getBuildLocation(supplyProvider, unit.getTilePosition))
    }
  }

I get the error

Error:(27, 15) stable identifier required, but bwapi.Race.Zerg found.
    case Race.Zerg => unit.train(unitType)
              ^

In addition, the following compiles just fine, when it shouldn't:

Race.Zerg = null
vjurenka commented 8 years ago

Thanks, for the information, these types all will become final in the next release.