No that doesn't work.
1. Your code gives me the same exception
2. A quick look with reflector shows me that eval.Run is just a wrapper
over eval.Evaluate.
3. To prove it, this works:
evaluator.Evaluate(class A{ public int X;}, out result, out set);
evaluator.Evaluate(var a = new A{X=10};, out result, out set);
evaluator.Evaluate(var b = new A{X=20};, out result, out set);
// this prints 30 without an exception
evaluator.Evaluate(print(a.X+b.X);, out result, out set);
It's only the GetType call that trips up the compiler.
Cheers
-luke
On Fri, Jan 25, 2013 at 12:58 PM, Robert Jordan [via Mono]
ml-node+s1490590n4658289...@n4.nabble.com wrote:
On 25.01.2013 18:33, lukebuehler wrote:
//this doesnt work
evaluator.Evaluate(var a = new A();, out result, out set);
//Error here:
evaluator.Evaluate(a.GetType();, out result, out set);
Console.WriteLine(result);
Local variables don't survive the evaluation. You must Run() them:
evaluator.Run(var a = new A(););
evaluator.Evaluate(a.GetType(););
Robert
___
Mono-devel-list mailing list
[hidden email] http://user/SendEmail.jtp?type=nodenode=4658289i=0
http://lists.ximian.com/mailman/listinfo/mono-devel-list
--
If you reply to this email, your message will be added to the discussion
below:
http://mono.1490590.n4.nabble.com/Mono-CSharp-Evaluator-x-GetType-Bug-tp4658288p4658289.html
To unsubscribe from Mono.CSharp.Evaluator: x.GetType Bug?, click
herehttp://mono.1490590.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4658288code=bHVrYXMuYnVlaGxlckBnbWFpbC5jb218NDY1ODI4OHw5NTQyOTA5MA==
.
NAMLhttp://mono.1490590.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
--
View this message in context:
http://mono.1490590.n4.nabble.com/Mono-CSharp-Evaluator-x-GetType-Bug-tp4658288p4658290.html
Sent from the Mono - Dev mailing list archive at Nabble.com.___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list