title: Compile Time Reflection in C#
body: <p>I frequently write C# code that has to use magic strings to express property names. Everyone knows the problems with magic strings. They are very difficult to refactor, they have no compile time checking, and often they lead to hard-to-diagnose issues. Yet C#/.NET uses them <em>all over the place</em> to represent property/class/method names.</p>
  
  <p>This issue has persisted for years and years, and the only viable solution currently is to use an expression tree which is then parsed at run-time for the property name. This gets you satisfactory compile-time checking, but it complicates the code (requiring parameters of type Expression), <em>and</em> it incurs a run-time cost. </p>
  
  <p>Does anyone know if there has ever been a feature consideration for C#/.NET to add compile-time reflection to overcome this pervasive problem? </p>
  
  <p>It seems like it would be an easy addition to make, it would be a non-breaking change, and it would greatly benefit many developers. The typeof() operator already performs a form of compile-time reflection, so it seems like an operator nameof() (or something similar) would be very complimentary.</p>
  
  <p>In addition, does anyone know of any potential issues with such a feature?</p>
  
  <p>Thanks for the help.</p>