In Scala:
def rules[T]: Array[Rule[T]]= { ... }
vs.
def rules: Array[Rule[T]] forSome {type T} = { ... }
They are not the same because in some cases only the latter one is working.
forSome marks an existential type. Existential types may be used for client side type variance, which might be required for your use case. You can read more under this question.
What is the forSome keyword in Scala for?
or in the linked article
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.