title: How to solve binding to const/non-const types?
body: <p><em>This question is about compiler internals</em>.</p>
  
  <p>Consider a language like C++ or D which has the notion of <code>const</code> type. For example one could write:</p>
  
  <pre><code>const Foo a = ...; // a is of type "const Foo"
  Foo b = ...;
  </code></pre>
  
  <p>And I am interested here in binding to a type -- how is it done? </p>
  
  <p>For now I can only think (sorry for crazy amateur ideas) -- of doubling entire type tree, making for each type <code>T</code> its const twin and putting it as a parent. Another would be to bind as usual (as with language with no such distinction) however making binding richer with info whether the binding itself is for <code>const</code> type or not.</p>
  
  <p>But how is it solved for real?</p>