This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Android REPL - add* syntax-sugar not available in constructor
Per Bothner wrote:
>
>
> But what is puzzling is why Invoke.applyN is called at runtime.
> The "pre-compiler" is supposed to call CompileInvoke#validateApplyInvoke
> - and this should be called by eval, when if the bytecode compiler
> is unavailable. Mapping "xxx:" to "addXxx" is supposed to be handled
> by the CompiledBuildObject#findNamedMember and #buildSetter methods.
>
It looks like compilerAvailable #f and alwaysCompile #f triggers the error,
even on the desktop version.
$ java -jar kawa-1.11.jar
#|kawa:1|# (java.awt.List item: "foo" item: "bar") ; this works
java.awt.List[list0,0,0,0x0,invalid,selected=null]
#|kawa:2|# (set! gnu.expr.ModuleExp:compilerAvailable #f)
#|kawa:3|# (set! gnu.expr.ModuleExp:alwaysCompile #f)
#|kawa:4|# (java.awt.List item: "foo" item: "bar") ; this fails
java.lang.RuntimeException: no such field item in java.awt.List
at gnu.kawa.reflect.SlotSet.apply(SlotSet.java:115)
at gnu.kawa.reflect.Invoke.applyN(Invoke.java:239)
at gnu.kawa.reflect.Invoke.apply(Invoke.java:99)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:234)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:180)
at kawa.Shell.run(Shell.java:279)
at kawa.Shell.run(Shell.java:194)
at kawa.Shell.run(Shell.java:175)
at kawa.repl.main(repl.java:884)
#|kawa:5|#
--
View this message in context: http://old.nabble.com/Android-REPL---add*-syntax-sugar-not-available-in-constructor-tp33222365p33223474.html
Sent from the Sourceware - kawa list mailing list archive at Nabble.com.