title: Custom Block Magento 2 isnt't working
body: <p>i wanted to add a new function to <code>\Magento\Catalog\Block\Product\View</code></p>
  
  <p>what i did:</p>
  
  <p><strong>1.</strong> <code>app/code/Company/Module</code></p>
  
  <p><strong>composer.json</strong></p>
  
  <pre><code>{
      "name": "Company/Module",
      "description": "N/A",
      "require": {
          "php": "~5.5.0|~5.6.0|~7.0.0"
      },
      "type": "magento2-module",
      "version": "100.0.2",
      "license": [
          "OSL-3.0",
          "AFL-3.0"
      ],
      "autoload": {
          "files": [
              "registration.php"
          ],
          "psr-4": {
              "Magento\\Cms\\": ""
          }
      }
  }
  </code></pre>
  
  <p><strong>registration.php</strong></p>
  
  <pre><code>&lt;?php
  /**
   * Copyright © 2015 Magento. All rights reserved.
   * See COPYING.txt for license details.
   */
  
  \Magento\Framework\Component\ComponentRegistrar::register(
      \Magento\Framework\Component\ComponentRegistrar::MODULE,
      'Company_Module',
      __DIR__
  );
  </code></pre>
  
  <p><strong>2.</strong> <code>app/code/Company/Module/Product/View</code></p>
  
  <p>Inside this file: </p>
  
  <pre><code> &lt;?php
  
  namespace Company\Module\Block\Product;
  
  class View extends \Magento\Catalog\Block\Product\View {
  
      private function trySomething()
      {
  
          exit('test');return '123';
      }
  }
  
  
  ?&gt;
  </code></pre>
  
  <p><strong>3.</strong>  <code>app/code/Company/Module/etc</code></p>
  
  <p>Inside this folder:</p>
  
  <pre><code>di.xml
  </code></pre>
  
  <p>Content: </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\Catalog\Block\Product\View" type="Company\Module\Block\Product\View" /&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>Also in the folder: </p>
  
  <pre><code>module.xml
  </code></pre>
  
  <p>Content: </p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"&gt;
      &lt;module name="Company_Module" setup_version="1.0.0"&gt;
  
      &lt;/module&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>I am tying to call the function over a template, included into product_detail like this:</p>
  
  <pre><code>/**
   * Product view template
   *
   * @var $block \Company\Module\Block\Product\View
   */
  
  ?&gt;
  &lt;?php echo  $block-&gt;trySomething(); ?&gt;
  
  This is just another test
  </code></pre>
  
  <p>The Text "This is just another test" is shown correctly on product_detail but the function won't be called. </p>
  
  <p>Hope someone can help me.</p>