17037, “vasslitvinov”, “CG: init, deinit, assign?”, “2021-01-28T22:12:00Z”
main issue: #8629
Should a CG function or the default implementation of a required function be able to initialize a variable of an interface type? deinitialize? assign?
Should this be contingent on the interface requiring the corresponding init/deinit/= functions? For example:
interface Assignable { proc =(ref Self, Self); }
proc myAssign(ref lhs: ?T, rhs: T) where T implements Assignable {
lhs = rhs;
}
interface CanDeclareVariable {
proc Self.init();
proc factory(): Self { var x: Self; return x; }
}