.Net Reflector 10

Help for older versions available.

These pages cover .Net Reflector 10, which is not the latest version. Help for other versions is also available.

.NET Reflector 9.3 release notes

22nd November, 2017

Features

Beta support for the following C# 7.0 features:

  • Tuples

    1. class TestValueTuples
    2. {
    3. public (int Key, string Value)[] TestArray;
    4. public IEnumerator<(int Key, string Value)> TestInnerType;
    5. public (int Key, string Value) TestField;
    6. public (int Key, string Value) TestProperty { get; set; }
    7. public (int Key, string Value) TestMethod() { throw new NotImplementedException(); }
    8. public Func<(int Key, string Value)> TestFunc;
    9. public event EventHandler<(int Key, string Value)> TestEvent;
    10.  
    11. public (int Q, int W) Method1((int Key, string Value) arg)
    12. {
    13. Console.WriteLine(TestField.Value);
    14. Console.WriteLine(TestProperty.Value);
    15. Console.WriteLine(TestMethod().Value);
    16. Console.WriteLine(arg.Value);
    17. Console.WriteLine(TestInnerType.Current.Value);
    18. Console.WriteLine(TestArray[0].Value);
    19. Console.WriteLine(TestFunc().Value);
    20. Console.WriteLine(TestFunc.Invoke().Value);
    21. TestEvent += (sender, tuple) => { Console.WriteLine(tuple.Value); };
    22. return (8, 16);
    23. }
    24. }
  • Out variables

    1. int TestMethod1(Dictionary<string, int> arg, string key)
    2. {
    3. if (!arg.TryGetValue(key, out var result))
    4. result = 0;
    5.  
    6. return result;
    7. }
  • Pattern Matching

    1. int TestMethod1<T>(IEnumerable<T> arg)
    2. {
    3. switch (arg)
    4. {
    5. case IList<T> tmp:
    6. return 1;
    7. case IEnumerable<int> tmp
    8. when tmp.Any():
    9. return tmp.First();
    10. case Queue<T> tmp:
    11. return 2;
    12. case Stack<T> tmp:
    13. return 3;
    14. }
    15. return 4;
    16. }
    17. int TestMethod2<T>(IEnumerable<T> arg)
    18. {
    19. if(arg is List<T> list)
    20. return list.Count;
    21. return 0;
    22. }
    23.  
  • Deconstruction

    1. class TestDeconstructors
    2. {
    3. private int a, b, c;
    4. public void Deconstruct(out int a, out int b, out int c)
    5. {
    6. a = this.a;
    7. b = this.b;
    8. c = this.c;
    9. }
    10.  
    11. public void Method1(TestDeconstructors other)
    12. {
    13. (a, b, c) = other;
    14. }
    15. }
  • Discards

    1. int TestMethod1<T>(IEnumerable<T> arg)
    2. {
    3. switch (arg)
    4. {
    5. case IList<T> _:
    6. return 1;
    7. case IEnumerable<int> tmp
    8. when tmp.Any():
    9. return tmp.First();
    10. case Queue<T> _:
    11. return 2;
    12. case Stack<int> tmp:
    13. return tmp.Peek();
    14. }
    15.  
    16. return 4;
    17. }
    18.  
    19. int TestMethod2<TKey, TResult>(Dictionary<TKey, TResult> arg)
    20. {
    21. return arg.TryGetValue(default(TKey), out _) ? 1 : 0;
    22. }
    23.  
  • Literals

    1. int num = 1_000_000;
  • Throw Expressions

    1. public static void Method1(IEnumerable<int> asd)
    2. {
    3. var tmp = (asd as IList<int>) ?? throw new ArgumentNullException(nameof(asd));
    4. }

Fixes

  • RP-4058 - (VsPackage): on F12 Jump, find proper declaration based on metadata line


Didn't find what you were looking for?