Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 09-08-2004
damingyipai damingyipai is offline
Registered User
 
 
Join Date: Jan 2004
Posts: 59
exception specification error in slice2cs

hello everyone

the slice:


exception A {
string reason;
};

exception B extends A {};

class Test
{
void foo() throws B, A;
}

I need code is follow:

...
catch(B ex)
{
... }
catch(A ex)
{
.. }

but the code that was generate by slice2cs is:

...
catch(A ex)
{
... }
catch(B ex)
{
.. }


then build error CS0160.

please check this bug, thanks.
Reply With Quote
  #2 (permalink)  
Old 09-08-2004
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 896
Patch available

Thanks for the bug report!

I've posted a patch in the Patches forum.

Note that you can avoid the problem entirely by not mentioning a base exception and one ore more of its derived exceptions in an exception specification. For example, for your Slice definitions:
Code:
exception A {
    string reason;
};

exception B extends A {};

class Test
{
   void foo() throws A; // No need to mention B here, because a B "is-a" A.
}
The next release of Icicle will have this fixed of course, or you can apply the patch now, or you can not apply the patch and just delete the derived exception from the exception specification.

Cheers,

Michi.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the difference between generatecs.exe and slice2cs.exe? bartley Help Center 1 08-09-2006 07:37 PM
Where can I find specification about Ice? kingbo Help Center 1 07-28-2005 04:18 AM
slice2cs - no output kwaclaw Help Center 8 06-24-2005 06:52 PM
Patch #2 for slice2cs, release 1.5.1 michi Patches 0 10-26-2004 11:11 PM
Possible bug in slice2cs version 1.5 wodi Bug Reports 3 07-27-2004 10:06 PM


All times are GMT -4. The time now is 08:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.