16825, “vasslitvinov”, “CG: when to resolve an interface declaration?”, “2020-12-08T02:37:57Z”
main issue: #8629 related: #16411
There are a couple of things in an interface declaration that may need resolving, for example:
interface MyIFC(type T) {
proc reqFn(arg: someExpr()) { // when is someExpr() evaluated?
..... // when is the default implementation resolved?
}
}
(text-order) This would be similar to how a variable’s initializer is resolved, ex.
var x: typeExpr() = initExpr(); // both are resolved when the var decl is encountered
(on-demand) This would be similar to how a record’s contents are resolved, ex.
record R {
type t = typeExpr(); // resolved upon a reference to the type `R`
var x = initExpr(); // both are resolved as part of the initializer upon `new R(...)`
}