Currently, we have to specify the exact type a Container contains.
For example: Struct implements Container<WeakPtr<Field>>.
This PR lets us omit the WeakPtr in the middle and just say: Container<Field>.
I think it's more readable and less cluttered.
In the past, this was necessary because of Modules, since they didn't store a WeakPtr<T>.
(What would T be? Modules can hold structs, classes, etc. No single T works).
But now that modules are simpler, everything holds a WeakPtr<T>.
So we no longer need to specify WeakPtr, since we always know it's there.
We can simplify the type signature, and improve the contents function to automatically borrow the ptrs.
Question for Reviewers
As of this PR, we have some functions (fields, enumerators, operations) that are just wrappers that call contents. Should we keep these functions for the better names?
Or should we just delete them, and just call contents directly?
Currently, we have to specify the exact type a
Container
contains. For example:Struct
implementsContainer<WeakPtr<Field>>
. This PR lets us omit theWeakPtr
in the middle and just say:Container<Field>
. I think it's more readable and less cluttered.In the past, this was necessary because of Modules, since they didn't store a
WeakPtr<T>
. (What wouldT
be? Modules can hold structs, classes, etc. No singleT
works). But now that modules are simpler, everything holds aWeakPtr<T>
.So we no longer need to specify
WeakPtr
, since we always know it's there. We can simplify the type signature, and improve thecontents
function to automatically borrow the ptrs.Question for Reviewers
As of this PR, we have some functions (
fields
,enumerators
,operations
) that are just wrappers that callcontents
. Should we keep these functions for the better names? Or should we just delete them, and just callcontents
directly?