this should work only for Pairs with the same generics
now u dont store types with instantiated generics as separated types so this is not possible
1) if receiver type of method decl after resolving still contains unresolved generics(T, G) then store it somehow inside TypeDB
For example create a list of instantiated types inside type and store this type like Pair(List::T, List::T) not Pair(T, G) inside and search there
2) store receivers of methods separatelly from types itself, and typecheck it this receiver the same as receeiver of this type
such typecheck would be needed only for types with generics since they can be instanciated with different types
Pair(List::T, List::T) forEach = []
this should work only for Pairs with the same generics
now u dont store types with instantiated generics as separated types so this is not possible
1) if receiver type of method decl after resolving still contains unresolved generics(T, G) then store it somehow inside TypeDB
For example create a list of instantiated types inside type and store this type like Pair(List::T, List::T) not Pair(T, G) inside and search there
2) store receivers of methods separatelly from types itself, and typecheck it this receiver the same as receeiver of this type
such typecheck would be needed only for types with generics since they can be instanciated with different types