<HTML>
<HEAD>
<TITLE>Re: [IronPython] Silverlight: Cannot cast from 'System.Nullable`1[System.Boolean]' to 'System.Boolean'</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Oh, from your VideoBrush thread? Didn’t try it ... I’ll look now<BR>
<BR>
<BR>
On 5/28/08 11:46 AM, "Michael Foord" <<a href="fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Jimmy Schementi wrote:<BR>
> Yay for finding a IronPython bug =) Does it work if you do IsChecked =<BR>
> None as well? Dino, do you know about this?<BR>
><BR>
<BR>
I'll try setting IsChecked to None.<BR>
<BR>
Did you see that on the Mac (Safari) I'm not getting the MediaEnded<BR>
event on a MediaElement when a video stops playing? Probably not an<BR>
IronPython bug, more likely a Silverlight one. It used to work for 1.1<BR>
Alpha though (I get a CurrentStateChanged event where the state changes<BR>
to Buffering instead!).<BR>
<BR>
Michael<BR>
<BR>
> ~js<BR>
><BR>
> On 5/17/08 11:46 AM, "Michael Foord" <<a href="fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>> wrote:<BR>
><BR>
> This is cool. I have a checkbox in my silverlight UI.<BR>
><BR>
> I have a code path that does:<BR>
><BR>
> if self.remember_me.IsChecked:<BR>
> PutStored(username, password)<BR>
><BR>
> The *second* time through this code path it blows up with the<BR>
> exception<BR>
> below. I can fix it by changing the test to:<BR>
><BR>
> if self.remember_me.IsChecked == True:<BR>
> PutStored(username, password)<BR>
><BR>
> Which works fine, but I thought you might be interested. :-)<BR>
><BR>
> Full traceback below...<BR>
><BR>
> ArgumentException: Cannot cast from<BR>
> 'System.Nullable`1[System.Boolean]'<BR>
> to 'System.Boolean'<BR>
> ArgumentException<BR>
> at Microsoft.Scripting.Ast.LambdaCompiler.EmitCast(Type from, Type to)<BR>
> at Microsoft.Scripting.Ast.LambdaCompiler.Emit(UnaryExpression node)<BR>
> at<BR>
> Microsoft.Scripting.Ast.LambdaCompiler.EmitExpression(Expression node)<BR>
> at Microsoft.Scripting.Ast.LambdaCompiler.Emit(BinaryExpression node)<BR>
> at<BR>
> Microsoft.Scripting.Ast.LambdaCompiler.EmitExpression(Expression node)<BR>
> at Microsoft.Scripting.Ast.LambdaCompiler.EmitReturn(Expression expr)<BR>
> at Microsoft.Scripting.Ast.LambdaCompiler.Emit(ReturnStatement node)<BR>
> at<BR>
> Microsoft.Scripting.Ast.LambdaCompiler.EmitExpression(Expression node)<BR>
> at Microsoft.Scripting.Actions.StandardRule`1.Emit(LambdaCompiler cg,<BR>
> Label ifFalse)<BR>
> at Microsoft.Scripting.Actions.SmallRuleSet`1.MakeTarget(CodeContext<BR>
> context)<BR>
> at Microsoft.Scripting.Actions.RuleSet`1.GetOrMakeTarget(CodeContext<BR>
> context)<BR>
> at<BR>
> Microsoft.Scripting.Actions.DynamicSiteHelpers.UpdateSite[T](CodeContext<BR>
> callerContext, Object site, T& target, RuleSet`1& rules,<BR>
> StandardRule`1<BR>
> rule)<BR>
> at<BR>
> Microsoft.Scripting.Actions.RuleTree`1.GetRuleMaybeExecute(CodeContext<BR>
> callerContext, Object[] args, Boolean execute, Object site, T& target,<BR>
> RuleSet`1& rules, Object& result)<BR>
> at<BR>
> Microsoft.Scripting.Actions.RuleTree`1.ExecuteRuleAndUpdateSite(CodeContext<BR>
> callerContext, Object[] args, Object site, T& target, RuleSet`1&<BR>
> rules,<BR>
> Object& result)<BR>
> at<BR>
> Microsoft.Scripting.Actions.RuleCache.ActionRuleCache.ExecuteRuleAndUpdateSite[T](CodeContext<BR>
> context, Object[] args, Object site, T& target, RuleSet`1& rules,<BR>
> Object& result)<BR>
> at<BR>
> Microsoft.Scripting.Actions.RuleCache.ExecuteRuleAndUpdateSite[T](CodeContext<BR>
> callerContext, DynamicAction action, Object[] args, Object site, T&<BR>
> target, RuleSet`1& rules, Object& result)<BR>
> at<BR>
> Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext<BR>
> callerContext, DynamicAction action, Object[] args, Object site, T&<BR>
> target, RuleSet`1& rules)<BR>
> at<BR>
> Microsoft.Scripting.Actions.DynamicSite`2.UpdateBindingAndInvoke(CodeContext<BR>
> context, T0 arg0)<BR>
> at<BR>
> Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke1(DynamicSite`2<BR>
> site, CodeContext context, T0 arg0)<BR>
> at Microsoft.Scripting.Actions.DynamicSite`2.Invoke(CodeContext<BR>
> context,<BR>
> T0 arg0)<BR>
> at _stub_##224(Closure , DynamicSite`2 , CodeContext , Object )<BR>
> at Microsoft.Scripting.Actions.DynamicSite`2.Invoke(CodeContext<BR>
> context,<BR>
> T0 arg0)<BR>
> at S$3.onLogin$18(Closure , Object self, Object sender, Object event)<BR>
> at Microsoft.Scripting.Utils.InvokeHelper`5.Invoke(Object arg0, Object<BR>
> arg1, Object arg2, Object arg3)<BR>
> at Microsoft.Scripting.Utils.ReflectedCaller.InvokeInstance(Object<BR>
> instance, Object[] args)<BR>
> at Microsoft.Scripting.Ast.Interpreter.InvokeMethod(MethodInfo method,<BR>
> Object instance, Object[] parameters)<BR>
> at<BR>
> Microsoft.Scripting.Ast.Interpreter.InterpretMethodCallExpression(CodeContext<BR>
> context, Expression expr)<BR>
> at Microsoft.Scripting.Ast.Interpreter.Interpret(CodeContext context,<BR>
> Expression expr)<BR>
> at<BR>
> Microsoft.Scripting.Ast.Interpreter.InterpretReturnStatement(CodeContext<BR>
> context, Expression expr)<BR>
> at Microsoft.Scripting.Ast.Interpreter.Interpret(CodeContext context,<BR>
> Expression expr)<BR>
> at Microsoft.Scripting.Ast.Interpreter.Execute(CodeContext context,<BR>
> Expression expression)<BR>
> at Microsoft.Scripting.Actions.StandardRule`1.ExecuteTarget(Object<BR>
> site,<BR>
> CodeContext context, Object[] args)<BR>
> at<BR>
> Microsoft.Scripting.Actions.RuleTree`1.GetRuleMaybeExecute(CodeContext<BR>
> callerContext, Object[] args, Boolean execute, Object site, T& target,<BR>
> RuleSet`1& rules, Object& result)<BR>
> at<BR>
> Microsoft.Scripting.Actions.RuleTree`1.ExecuteRuleAndUpdateSite(CodeContext<BR>
> callerContext, Object[] args, Object site, T& target, RuleSet`1&<BR>
> rules,<BR>
> Object& result)<BR>
> at<BR>
> Microsoft.Scripting.Actions.RuleCache.ActionRuleCache.ExecuteRuleAndUpdateSite[T](CodeContext<BR>
> context, Object[] args, Object site, T& target, RuleSet`1& rules,<BR>
> Object& result)<BR>
> at<BR>
> Microsoft.Scripting.Actions.RuleCache.ExecuteRuleAndUpdateSite[T](CodeContext<BR>
> callerContext, DynamicAction action, Object[] args, Object site, T&<BR>
> target, RuleSet`1& rules, Object& result)<BR>
> at<BR>
> Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext<BR>
> callerContext, DynamicAction action, Object[] args, Object site, T&<BR>
> target, RuleSet`1& rules)<BR>
> at<BR>
> Microsoft.Scripting.Actions.DynamicSite`5.UpdateBindingAndInvoke(CodeContext<BR>
> context, T0 arg0, T1 arg1, T2 arg2, T3 arg3)<BR>
> at<BR>
> Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke4(DynamicSite`5<BR>
> site, CodeContext context, T0 arg0, T1 arg1, T2 arg2, T3 arg3)<BR>
> at Microsoft.Scripting.Actions.DynamicSite`5.Invoke(CodeContext<BR>
> context,<BR>
> T0 arg0, T1 arg1, T2 arg2, T3 arg3)<BR>
> at _stub_##217(Closure , DynamicSite`4 , CodeContext , Object ,<BR>
> Object ,<BR>
> Object )<BR>
> at Microsoft.Scripting.Actions.DynamicSite`4.Invoke(CodeContext<BR>
> context,<BR>
> T0 arg0, T1 arg1, T2 arg2)<BR>
> at System.Void(Object, RoutedEventArgs), using<BR>
> PythonBinder##183(Closure<BR>
> , Object , RoutedEventArgs )<BR>
> at System.Windows.Controls.Primitives.ButtonBase.OnClick()<BR>
> at<BR>
> System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs<BR>
> e)<BR>
> at<BR>
> System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(Object<BR>
> sender, MouseButtonEventArgs e)<BR>
> at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32<BR>
> typeIndex,<BR>
> Delegate handlerDelegate, Object sender, Object args)<BR>
> at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr<BR>
> unmanagedObjArgs, Int32 argsTypeIndex, String eventName)<BR>
> ? Hide<BR>
> Debugging Output<BR>
><BR>
><BR>
> Michael Foord<BR>
> <a href="http://www.ironpythoninaction.com/">http://www.ironpythoninaction.com/</a><BR>
><BR>
><BR>
> _______________________________________________<BR>
> Users mailing list<BR>
> <a href="Users@lists.ironpython.com">Users@lists.ironpython.com</a><BR>
> <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><BR>
><BR>
> ------------------------------------------------------------------------<BR>
><BR>
> _______________________________________________<BR>
> Users mailing list<BR>
> <a href="Users@lists.ironpython.com">Users@lists.ironpython.com</a><BR>
> <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><BR>
><BR>
<BR>
<BR>
--<BR>
<a href="http://www.ironpythoninaction.com/">http://www.ironpythoninaction.com/</a><BR>
<a href="http://www.theotherdelia.co.uk/">http://www.theotherdelia.co.uk/</a><BR>
<a href="http://www.voidspace.org.uk/">http://www.voidspace.org.uk/</a><BR>
<a href="http://www.ironpython.info/">http://www.ironpython.info/</a><BR>
<a href="http://www.resolverhacks.net/">http://www.resolverhacks.net/</a><BR>
<BR>
_______________________________________________<BR>
Users mailing list<BR>
<a href="Users@lists.ironpython.com">Users@lists.ironpython.com</a><BR>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>