Announcement

Collapse
No announcement yet.

[CLOSED] [#2925] IList in Bridge doesn't match System.Collections from Windows

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

    [CLOSED] [#2925] IList in Bridge doesn't match System.Collections from Windows

    Windows:

    namespace System.Collections
    {
        using System;
        using System.Reflection;
        using System.Runtime.InteropServices;
    
        [ComVisible(true), __DynamicallyInvokable]
        public interface IList : ICollection, IEnumerable
        {
            [__DynamicallyInvokable]
            int Add(object value);
            [__DynamicallyInvokable]
            void Clear();
            [__DynamicallyInvokable]
            bool Contains(object value);
            [__DynamicallyInvokable]
            int IndexOf(object value);
            [__DynamicallyInvokable]
            void Insert(int index, object value);
            [__DynamicallyInvokable]
            void Remove(object value);
            [__DynamicallyInvokable]
            void RemoveAt(int index);
    
            [__DynamicallyInvokable]
            bool IsFixedSize { [__DynamicallyInvokable] get; }
    
            [__DynamicallyInvokable]
            bool IsReadOnly { [__DynamicallyInvokable] get; }
    
            [__DynamicallyInvokable]
            object this[int index] { [__DynamicallyInvokable] get; [__DynamicallyInvokable] set; }
        }
    }
    Bridge:

    [DefaultMember("Item")]
        [External]
        public interface IList : ICollection, IEnumerable, IBridgeClass
        {
            object this[int index] { get; set; }
    
            //
            // Summary:
            //     Gets a value indicating whether the IList is read-only.
            bool IsReadOnly { get; }
    
            [Template("System.Array.add({this}, {item})")]
            void Add(object item);
            [Template("System.Array.clear({this})")]
            void Clear();
            [Template("System.Array.contains({this}, {item})")]
            bool Contains(object item);
            [Template("System.Array.indexOf({this}, {item}, 0, null)")]
            int IndexOf(object item);
            [Template("System.Array.insert({this}, {index}, {item})")]
            void Insert(int index, object item);
            [Template("System.Array.remove({this}, {item})")]
            bool Remove(object item);
            [Template("System.Array.removeAt({this}, {index})")]
            void RemoveAt(int index);
        }
    Add (returns int) and Remove doesn't return bool (void)

    not sure if this is a .net Framework issue or miss match -

    #2
    Hi. Thanks for the report. Can you share a Deck demonstrating the scenario? As well, a link to a DotNetFiddle demonstrating the same scenario with the expected results would be helpful.

    Comment


      #3
      Yeah sure will do

      Comment


        #4
        Fiddler: https://dotnetfiddle.net/jm0hUI - cant compile. same interface doesn't compile.

        Deck can: https://deck.net/d1deb6166d41b55eaa6b6f637a039e2b (using Deck IList interface)

        - IList Implementation via windows/system.collections

        Fiddler: https://dotnetfiddle.net/hhahX9

        one where Deck fails to build: https://deck.net/9a2bebcace4ad57c36c41d954ea5f46e

        Comment


          #5
          Looks like the Add method of System.Collections.IList interface in Bridge should have a return type of int, not void.

          https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx

          https://github.com/bridgedotnet/Brid...s/IList.cs#L12

          Comment


            #6
            Issue #2925 has been created to track this defect. We will try to fix right away.

            Comment


              #7
              Thank you for the fast response

              Comment


                #8
                This issue was fixed in the Bridge 16.3.0 release.

                Hope this helps.

                Comment

                Working...
                X