Hi Carolyn, Thanks for assumption. Yes, I can define function return type other than void and it also works fine. It's not critical issue for me, there are few workarounds. But out of curiosity, why the "return ;" statement throws runtime error in the original example, but works well outside of try/finally block:
<snip> private function test1():void { var i:int = 0; if( i==2 ) return; // <- it's OK } </snip> -- Thanks, Vadim. ----- Original Message ----- From: Carolyn Cole To: flexcoders@yahoogroups.com Sent: Friday, February 24, 2006 8:16 PM Subject: Re: [flexcoders] Runtime Error #1068: void and * cannot be reconciled Just a guess here... You defined the function as void. When you call the return statement with no value it probably gets the * type. You could define your function to have a return type you do not use, or drop the void return type. At 01:04 PM 2/24/2006, you wrote: Hi João, >> Isn't missing a { after the if( i==2 )? << In my understanding missed { will cause compilation error, but this code compiles w/o any problem and throws exception at runtime. Probably it's mxmlc or AS3 engine bug, similar code worked well with previous Flex 1.5/AS2. Anyway surrounding return statement with {} doesn't help, to fix this problem code has to be rewritten using if/else statements to prevent "return" usage. -- Thanks, Vadim. ----- Original Message ----- From: João Fernandes To: flexcoders@yahoogroups.com Sent: Friday, February 24, 2006 7:37 PM Subject: RE: [flexcoders] Runtime Error #1068: void and * cannot be reconciled Isn't missing a { after the if( i==2 )? João Fernandes Sistemas de Informação Programador Informático Cofina media Avenida João Crisóstomo, Nº 72 . 1069-043 Lisboa PORTUGAL Tel (+351) 213 185 200 . Fax (+351) 213 540 370 [EMAIL PROTECTED] From: flexcoders@yahoogroups.com [ mailto:[EMAIL PROTECTED] On Behalf Of Vadim Melnik Sent: sexta-feira, 24 de Fevereiro de 2006 17:33 To: flexcoders@yahoogroups.com Subject: [flexcoders] Runtime Error #1068: void and * cannot be reconciled Hi All, I've got runtime ActionScript error when "return" statement placed inside try/finally block. Small test case attached below, it reports me: VerifyError: Error #1068: void and * cannot be reconciled. Is it correct AS3 behaviour? <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx=" http://www.macromedia.com/2005/mxml" xmlns="*" creationComplete="test1()"> <mx:Script><![CDATA[ private function test1():void { var i:int = 0; try { i = 1; if( i==2 ) return; // <- error statement } finally { i = 0; } } ]]></mx:Script></mx:Application> -- Thanks, Vadim. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders " on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/