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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      558 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X