16820, “vasslitvinov”, “CG: allow generic ‘implements’ statements?”, “2020-12-07T14:58:31Z”
Main issue: #8629 Related: #16731
Should we allow an ‘implements’ statement that has generic actual arguments? For example:
implements MyIFC([] int); // works for any array
implements MyIFC([D] ?T) where isIntegral(T); // array of any integer elements
implements MyIFC(list[?T]) where implements MyIFC(T); // as long as elements comply with MyIFC
implements MyIFC(MyClass); // works for owned, borrowed, ...
implements MyIFC(MyClass??); // works for nilable and non-nilable argument
implements MyIFC(?T: MyClass); // works for any subclass of MyClass
If so, how should it work / how should it affect early resolution when user code calls a function constrained by MyIFC, such as:
proc cgFun(arg: ?T) where implements MyIFC(T) {...}