Is it possible to cast Map to Map when it is known that Field and Value extend Mirror?

前端 未结 1 407
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-15 13:34

I am trying to cast upwards Map to Map. It makes sense for the cast to work, as both Field and Val

相关标签:
1条回答
  • 2021-01-15 13:51

    I think that would be possible only if you define the

    Map<Field, Value> 
    

    as

    Map<? extends Mirror, ? extends Mirror>
    

    But otherwise, it's not the same thing.

    0 讨论(0)
提交回复
热议问题