I've read a number of posts about this but I'm still not sure that I fully understand the definitions.
Here's what I think are examples of the different terms. Am I on the right track here, or do I still not understand the concepts. Thanks
Array<T TArray> - unbound and open.
Array<int> - bound and closed.
Array<Array<T TArray> - bound and open.
Array<Array<int>> - bound and closed.
Unbound means something like typeof(Dictionary<,>). Unbound types are only interesting for Reflection and can only be used in typeof(), not in any other context.
All unbounds types are closed types, the combination "unbound and open" is impossible.
Assuming T is a type parameter of the current class/method:
Dictionary<,> - unbound and closed
Dictionary<string, int> - constructed and closed
Dictionary<int, T> - constructed and open
Dictionary<string, List<T>> - constructed and open
NonGenericClass - bound and closed
Note that there is no such thing as List<Dictionary<,>> - unbound types cannot be used as type arguments, only directly in typeof(). A type is either unbound, or completely bound.
And if a type is unbound, there's no place where it could refer to a type parameter, so the combination "unbound and open" is impossible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With