LocalVariableInfo.cs 778 B

1234567891011121314151617181920212223242526
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Diagnostics;
  5. namespace System.Reflection
  6. {
  7. public class LocalVariableInfo
  8. {
  9. public virtual Type LocalType { get { Debug.Fail("type must be set!"); return null; } }
  10. public virtual int LocalIndex => 0;
  11. public virtual bool IsPinned => false;
  12. protected LocalVariableInfo() { }
  13. public override string ToString()
  14. {
  15. string toString = LocalType.ToString() + " (" + LocalIndex + ")";
  16. if (IsPinned)
  17. toString += " (pinned)";
  18. return toString;
  19. }
  20. }
  21. }