Open waneck opened 9 years ago
Also unfortunately there's no way to call a @:generic
function from another function - be it @:generic
or inline
.
And since @:forward
doesn't work for static fields, there's no way to correctly deal with wrapping a type on an abstract if it has static fields/functions
Isn't this just another instance of #3033?
It's not. This one has to do with @:generic
types being generated with leaked type parameters - it has nothing to do with TMono
types
It's probably the same as #3663. We expand @:generic
while typing the inline function, so this is technically consistent.
It's not quite the same: #3663 is about inlining while generically expanding whereas this issue is about generically expanding while inlining.
One solution for this might be to allow partial generic expansion. Basically, if we substitute a generic type parameter with a non-generic one, we absorb that type parameter into the new function and make the function @:generic
again.
This would require reapplying calls to generic functions, but I think this is exactly the same situation as overload
calls for which we already do that anyway.
The following code:
Will generate the following
-D dump
forTest.something
:That
somethingElse.T
comes from the abstract type