title: Magento 2 override core framework
body: <p>i want to override AbstractBlock class, i tried with my custom module but it not working</p>
  
  <p>di.xml</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"&gt;
      &lt;preference for="Magento\Framework\View\Element\AbstractBlock" type="YourCompany\YourModule\Framework\View\Element\AbstractBlock" /&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>AbstractBlock.php</p>
  
  <pre><code>&lt;?php
  namespace YourCompany\YourModule\Framework\View\Element;
  
  abstract class AbstractBlock extends \Magento\Framework\View\Element\AbstractBlock {
  
      /**
       * Retrieve child block HTML
       *
       * @param   string $alias
       * @param   boolean $useCache
       * @return  string
       */
      public function getChildHtml($alias = '', $useCache = true)
      {
          die("here");
      }
  
  }
  </code></pre>