Skip to content

Properly update JIT disassembly to support new ClrMD #1334

Open

Description

@ashmind
No description provided.

Activity

  1. Mart-Bogdan commented on Sep 20, 2024

    @Mart-Bogdan

    this also doesn't work

    static class MyLinq
    {
        [JitGeneric(typeof(int[]), typeof(int))]
        [JitGeneric(typeof(List<int>), typeof(int))]
        static public T MySum<TE, T>(this TE e)
            where TE : IEnumerable<T>
            where T : INumberBase<T>
        {
            T sum = T.Zero;
            foreach (T t in e)
            {
                sum += t;
            }
            return sum;
        }
    }

    But this one:

        [JitGeneric(typeof(List<int>.Enumerator), typeof(int))]
        public static T MySum<TE, T>(this TE e)
            where TE : IEnumerator<T>
            where T : INumberBase<T>
        {
            T sum = T.Zero;
            
            while (e.MoveNext())
            {
                sum += e.Current;
            }
            return sum;
        }

    works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions