16966, “vasslitvinov”, “CG: how to declare an interface’s parameter(s) ?”, “2021-01-19T22:20:48Z”
main issue: #8629
Which of the following styles do we want to support for an interface declaration?
(implicit) the type Self
is implicitly the formal
This would be particularly useful if we adopt (only-methods) from #16800
and/or disallow free functions, discussed in #16851
interface IFC {...} // the type 'Self' is implicitly the formal
(explicit) the formal(s) are listed explicitly
interface IFC(T) {...} // the type 'T' is the formal
(with-intent) the formal(s) are listed explicitly with type
or param
intent(s)
interface IFC(type T, param P) {...} // the type 'T' and the param 'P' are the formals
Related questions:
-
can an interface have multiple formals?
is there a compelling use case for it? -
can an interface have
param
formal(s)?
is there a compelling use case for it?