title: Same types but still error on global declaration "TS2717: Subsequent property declarations must have the same type with same type."
body: <p>Version 13.2.1 of the library <a href="https://github.com/shouldjs/should.js" rel="nofollow noreferrer">should</a> produces the following error when compiling with TypeScript 2.7.1 on Node 8.9.1:</p>
  
  <pre><code>node_modules/should/should.d.ts(237,5): error TS2717: Subsequent property 
  declarations must have the same type.  Property 'should' must be of type
   'Assertion', but here has type 'Assertion'.
  </code></pre>
  
  <p>I.e. pointing to this line in the type definition file: <a href="https://github.com/shouldjs/should.js/blob/9748ae607f80fbf544d4bb67db8e1e014de2301f/should.d.ts#L237" rel="nofollow noreferrer">https://github.com/shouldjs/should.js/blob/9748ae607f80fbf544d4bb67db8e1e014de2301f/should.d.ts#L237</a></p>
  
  <p>There is also an <a href="https://github.com/shouldjs/should.js/issues/147" rel="nofollow noreferrer">issue in the should.js github repository</a> where this has previously been discovered and thought to be solved.</p>
  
  <p><strong>Simplified error producing file</strong></p>
  
  <p>Below is a simplified version of the real file which produces the same error:</p>
  
  <pre><code>declare namespace should {
  
    interface Assertion {
      assert(expr: boolean): this;
      fail(): this;
    }
  }
  
  declare global {
    interface Object {
      should: should.Assertion;
    }
  }
  
  export as namespace should;
  
  export = should;
  </code></pre>
  
  <p><strong>Quick-fix</strong></p>
  
  <p>A simple solution would be to just skip the global declaration. This would satisfy my own use-case of the library but as the library is currently intended to allow this use-case it does not seem like an ideal scenario.</p>
  
  <p><strong>Question</strong></p>
  
  <p>Why does this declaration not work? And what would instead be a valid declaration?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Test related dependencies, some touching global type definitions and potentially clashing.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
        "devDependencies": {
          "@types/chai": "^4.1.2",
          "@types/chai-as-promised": "^7.1.0",
          "@types/mocha": "^2.2.48",
          "@types/proxyquire": "^1.3.28",
          "@types/request-promise": "^4.1.41",
          "@types/sinon": "^4.1.3",
          "@types/sinon-chai": "^2.7.29",
          "@types/supertest": "^2.0.0",
          "chai": "^4.0.0",
          "chai-as-promised": "^7.1.1",
          "chai-things": "^0.2.0",
          "mocha": "^3.4.2",
          "nyc": "^11.4.1",
          "proxyquire": "^1.8.0",
          "should": "^13.2.1",
          "sinon": "^4.2.2",
          "sinon-chai": "^2.14.0",
          "sinon-mongoose": "^2.0.2",
          "supertest": "^1.2.0"
        }
   }</code></pre>
  </div>
  </div>
  </p>