Results 1 to 3 of 3

Thread: slice2cs 3.4 tie classes use ObsoleteAttribute without namespace

  1. #1
    masariello is offline Registered User
    Name: Alessio Massaro
    Organization: VTB Capital
    Project: Quantitative Analytics Library
    Join Date
    Apr 2010
    Posts
    5

    slice2cs 3.4 tie classes use ObsoleteAttribute without namespace

    Hi All,

    afaict slice2cs 3.4 has a bug in the generation of tie classes. They look like the following and don't compile because the using statement in red prevents the compiler from resolving the Obsolete attribute in blue.

    Code:
    using _System = global::System;
    using _Microsoft = global::Microsoft;
    
    namespace MyModule
    {
        ...
        public class IMyInterfaceTie_ : IMyInterfaceDisp_, Ice.TieBase
        {
            ...
            [Obsolete("This method is deprecated, use GetHashCode instead.")]
            public override int ice_hash()
            {
                return GetHashCode();
            }
            ...
        }
        ...
    }
    If I understand the problem, the line in blue should be:

    Code:
    [_System.Obsolete("This method is deprecated, use GetHashCode instead.")]
    ZeroC, when do you think a fix will be made available? (if you agree the problem is there, of course :-) )

    Thank you

  2. #2
    masariello is offline Registered User
    Name: Alessio Massaro
    Organization: VTB Capital
    Project: Quantitative Analytics Library
    Join Date
    Apr 2010
    Posts
    5
    Just wanted to add one thing...

    The ice_hash method in the above post is actually overriden from a base abstract class in Ice.dll where it is marked as obsolete.

    The compiler issues a warning if the override is not marked as obsolete.

    This means defining a bogus ObsoleteAttribute in the same namespace as the tie class does not make the compiler happy, as System.ObsoleteAttribute is sealed.

    The only way around this problem is suppressing CS0672 and CS1591 for the whole project.

    This makes System.ObsoleteAttribute useless, which I think is a rather *major* sacrifice for big projects.

    This will make Ice a rather hard sell for my project. Please help, ZeroC!

  3. #3
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Hi Alessio,

    Thanks for reporting this. The generated ice_hash method is actually redundant because it's inherited from Ice.ObjectImpl.

    I've posted a patch for this issue. We'll also add a test for the next release to make sure we don't run into this again.

    Thanks,
    Mark

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. slice2cs enum bug when in another namespace
    By linkman in forum Bug Reports
    Replies: 1
    Last Post: 04-16-2011, 09:22 AM
  2. Replies: 5
    Last Post: 06-09-2010, 07:06 AM
  3. Replies: 1
    Last Post: 01-23-2009, 11:35 AM
  4. Freeze evictor synchronization with Java tie classes
    By jdekozak in forum Help Center
    Replies: 2
    Last Post: 01-30-2007, 01:12 PM
  5. Replies: 1
    Last Post: 11-17-2005, 09:17 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
  •