ArrayIndexOutOfBoundsException in let binding with strategy argument in testing language
The following test gives a
java.lang.ArrayIndexOutOfBoundsException
.
Strangely, the same code appears to work fine in the interpreter outside the testing language.
Term arguments to strategies in let bindings also appears to work fine.
test z
let
a(s) = s
in
a(id)
endStack:
java.lang.ArrayIndexOutOfBoundsException: 1
at org.spoofax.terms.StrategoAppl.getSubterm(StrategoAppl.java:54)
at org.spoofax.interpreter.core.Tools.applAt(Tools.java:24)
at org.spoofax.interpreter.core.StrategoCoreLoader.makeSVars(StrategoCoreLoader.java:229)
at org.spoofax.interpreter.core.StrategoCoreLoader.parseSDefT(StrategoCoreLoader.java:171)
at org.spoofax.interpreter.core.StrategoCoreLoader.parseLet(StrategoCoreLoader.java:147)
at org.spoofax.interpreter.core.StrategoCoreLoader.parseStrategy(StrategoCoreLoader.java:95)
at org.spoofax.interpreter.core.StrategoCoreLoader.parseSDefT(StrategoCoreLoader.java:188)
at org.spoofax.interpreter.core.Interpreter.evaluate(Interpreter.java:98)
at org.strategoxt.HybridInterpreter.evaluate(HybridInterpreter.java:396)
at org.strategoxt.HybridInterpreter.evaluate(HybridInterpreter.java:414)
at org.strategoxt.imp.testing.strategies.plugin_strategy_evaluate_1_2.invoke(plugin_strategy_evaluate_1_2.java:37)
at trans.check_error_0_0_fragment_0.invoke(check_error_0_0_fragment_0.java:1017)
at trans.check_error_0_0.invoke(check_error_0_0.java:28)
at org.strategoxt.stratego_lib.k_154.invoke(k_154.java)
at org.strategoxt.lang.SRTS_EXT_crush_3_0.invoke(SRTS_EXT_crush_3_0.java:28)
at org.strategoxt.lang.compat.override.performance_tweaks.foldr_3_0_override.invoke(foldr_3_0_override.java)
at org.strategoxt.stratego_lib.k_154.invoke(k_154.java)
at org.strategoxt.lang.SRTS_EXT_crush_3_0.invoke(SRTS_EXT_crush_3_0.java:28)
at org.strategoxt.lang.compat.override.performance_tweaks.foldr_3_0_override.invoke(foldr_3_0_override.java)
at org.strategoxt.stratego_lib.k_154.invoke(k_154.java)
at org.strategoxt.stratego_lib.collect_all_2_0.invoke(collect_all_2_0.java)
at trans.lifted2705.invoke(lifted2705.java:143)
at trans.lifted2626.invoke(lifted2626.java:75)
at org.strategoxt.stratego_lib.dr_scope_1_1.invoke(dr_scope_1_1.java)
at trans.lifted2625.invoke(lifted2625.java:40)
at org.strategoxt.stratego_lib.dr_scope_1_1.invoke(dr_scope_1_1.java)
at trans.scope_paths_1_2.invoke(scope_paths_1_2.java:39)
at trans.editor_analyze_0_0.invoke(editor_analyze_0_0.java:170)
at org.strategoxt.lang.Strategy.invokeDynamic(Strategy.java:30)
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:194)
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:185)
at org.strategoxt.lang.InteropSDefT$StrategyBody.evaluate(InteropSDefT.java:247)
at org.spoofax.interpreter.core.Interpreter.evaluate(Interpreter.java:107)
at org.spoofax.interpreter.core.Interpreter.invoke(Interpreter.java:80)
at org.strategoxt.HybridInterpreter.invoke(HybridInterpreter.java:379)
at org.strategoxt.imp.debug.core.str.launching.DebuggableHybridInterpreter.invoke(DebuggableHybridInterpreter.java:149)
at org.strategoxt.imp.runtime.Environment$2.invoke(Environment.java:210)
at org.strategoxt.imp.runtime.services.StrategoObserver.invoke(StrategoObserver.java:690)
at org.strategoxt.imp.runtime.services.StrategoObserver.invokeSilent(StrategoObserver.java:739)
at org.strategoxt.imp.runtime.services.StrategoObserver.update(StrategoObserver.java:486)
at org.strategoxt.imp.runtime.services.StrategoObserverUpdateJob.analyze(StrategoObserverUpdateJob.java:30)
at org.strategoxt.imp.runtime.services.StrategoAnalysisQueue$UpdateJob.run(StrategoAnalysisQueue.java:81)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)Spoofax version: 0.6.1.4-r23707
Submitted by Tobi Vollebregt on 9 December 2011 at 16:30
Issue Log
Another case of a missing desugaring in
HybridInterpreter.desugar()
.
Log in to post comments