Also worth noting is that if you specify a specific return type (i.e. boolean) at the call site, MOP will ensure that whatever method ends up invoked, the return value is converted (either using built-in JVM conversions, or even your own language-specific ones if you provide a GuardingTypeConverterFactory implementation).
Attila. On 2010.03.25., at 18:13, Charles Oliver Nutter wrote: > On Thu, Mar 25, 2010 at 10:12 AM, Rémi Forax <fo...@univ-mlv.fr> wrote: >> I've also found useful to propagate expected type back to the calling >> method. >> Example: >> if (foo()) { ... } >> >> should be translated to indy foo ()Z instead of ()Object because if () >> wait for a boolean. > > Yeah, I suppose this is appropriate for any "call" that is seen to be > receiving a dynamic type, i.e.: > > def foo(a:List, b:dynamic) > a.get(b.size) # size should be indy size()I > > I'll have to see what I'd need to do in Duby's type engine to have > "upstream" type requirements influence "downstream" inferred types. > > - Charlie _______________________________________________ mlvm-dev mailing list mlvm-dev@openjdk.java.net http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev