public void CompileAndEvaluateInnerBlockWithClosureUsingExternalArgument()
{
IClass cls = this.CompileClass(
"Adder",
new string[] { },
new string[] { "add: aVector with: aNumber | sum | sum := 0. aVector do: [ :x | sum := sum + x + aNumber ]. ^sum" });
Assert.IsNotNull(cls);
IMethod method = cls.GetInstanceMethod("add:with:");
Assert.IsNotNull(method);
IObject obj = (IObject)cls.NewObject();
Assert.AreEqual(9, method.Execute(cls.Machine, obj, new object[] { new int[] { 1, 2, 3 }, 1 }));
}