Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Syntax Warning on Ninja Editor but not Microsoft

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Syntax Warning on Ninja Editor but not Microsoft

    I get a warning in the Ninja editor but not the Microsoft Visual C# editor. It compiles and works fine but would like to remove the warning in Ninja.

    Any ideas what it doesn't like?


    Here is the statement:
    int IComparable<NonUniqueKey_<Type, TComparer>>.CompareTo(NonUniqueKey_<Type, TComparer> k)

    The errors displayed are:
    "> expected."
    "Class member declaration expected."


    Here is the block of code:
    public class NonUniqueKey_<Type, TComparer> : IComparable<NonUniqueKey_<Type, TComparer>>, IComparable
    where Type : IComparable<Type>
    where TComparer : IComparer<Type>
    {
    public static NonUniqueKey_<Type, TComparer> New(Type key, TComparer cmp)
    {
    return new NonUniqueKey_<Type, TComparer>(key, cmp);
    }

    Type _key;
    TComparer _cmp;
    public NonUniqueKey_()
    {
    }
    public NonUniqueKey_(Type key, TComparer cmp)
    {
    _key = key;
    _cmp = cmp;
    }
    public NonUniqueKey_(NonUniqueKey_<Type, TComparer> k)
    {
    _key = k._key;
    _cmp = k._cmp;
    }
    public NonUniqueKey_<Type, TComparer> Clone()
    {
    return new NonUniqueKey_<Type, TComparer>(this);
    }
    public int CompareTo(object o)
    {
    return (_cmp.Compare(_key, ((NonUniqueKey_<Type, TComparer>)o)._key) < 0) ? -1 : 1;
    }
    int IComparable<NonUniqueKey_<Type, TComparer>>.CompareTo(NonUniqueKey_<Type, TComparer> k)
    {
    return (_cmp.Compare(_key, k._key) < 0) ? -1 : 1;
    }

    public static explicit operator Type (NonUniqueKey_<Type, TComparer> k)
    {
    return k._key;
    }
    }

    #2
    Sorry I don't know. We rarely use C# generics.

    Comment


      #3
      Dierk

      Danke.

      Cliff

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sjsj2732, Yesterday, 04:31 AM
      0 responses
      35 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      287 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      286 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      133 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      95 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X