Results 1 to 2 of 2

Thread: exception specification error in slice2cs

  1. #1
    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.

  2. #2
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. slice2cs 3.3.0 Improvements
    By apwd in forum Bug Reports
    Replies: 5
    Last Post: 05-04-2010, 04:55 PM
  2. user exception causes unmarshalling exception
    By Stuart Brodsky in forum Help Center
    Replies: 9
    Last Post: 04-29-2009, 02:21 PM
  3. Replies: 1
    Last Post: 08-12-2008, 09:59 AM
  4. Replies: 2
    Last Post: 12-13-2006, 10:52 AM
  5. Where can I find specification about Ice?
    By kingbo in forum Help Center
    Replies: 1
    Last Post: 07-28-2005, 04:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •