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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      160 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      308 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      245 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      349 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X