Opaque types incompatible with inline
as representation leaks from opaque type's enclosing scope
#6662
Labels
inline
as representation leaks from opaque type's enclosing scope
#6662
Uh oh!
There was an error while loading. Please reload this page.
The following code worked fine as of 0.15.0-RC1:
As of 0.16.0-RC3 however, things have changed with opaque types as I understand it. I managed to get everything working again by wrapping in an Object. This code compiles fine:
However, suppose we uncomment the inline of
some
ornone
, then when using either of them we get this compiler error:This error is pretty obscure, but I imagine it is something to do with the new rules surrounding how opaque types are treated inside and outside of the defining scope (and inline probably makes that leak!).
Additionally, moving any of the extension methods into the
opt
object makes them give "Member not found errors" when used outside of theopt
object's scope if inline is not removed. Placing them inside adelegate for {}
and addinginline
makes a "An extension method was tried, but could not be fully constructed:" be given in addition. I'm fairly sure this is the same leakage problem, where they are not agreeing with the representation found outside theopt
object (and so are method not found) because they see the erased type.The text was updated successfully, but these errors were encountered: