Open vasslitvinov opened 4 years ago
@mppf what do you suggest we do here?
I think the code would need to be written as e.g.
class CC {
var ff: owned DD? = new owned DD();
forwarding ff!;
}
In other words it would not add the !
by default and the user could opt in to it if that is desired. (Or use a non-nilable type).
When a method is forwarded to a field of a nillable-class type, should the postfix-
!
be inserted automatically? should such forwarding be unavailable? other semantics?Currently, when #14559 is open, the above succeeds in a prototype module and fails in a production module. In a prototype module, the compiler inserts
!
implicitly, convertinginst.fun()
toinst.ff!.fun()
.