Type '() => void' is not assignable to type '() => {}' : <p>I understand the error message:</p>

<blockquote>
  <p>Type '() => void' is not assignable to type '() => {}'</p>
</blockquote>

<p>Well sort of, it is telling me there is a type casting issue. However I can't work out why the compiler thinks the types are not the same.</p>

<p>The back ground to the code is that I have a typescript class that is given a function and then stores it as a member. I want to be able to initialise the member with an empty 'noop' function so that it don't have to null check it before use.</p>

<p>I have managed to reduce problem down to the following example test code:</p>

<pre><code>export class Test {
    private _noop: () =&gt; {};

    constructor(
    ) {
        this._noop = () =&gt; { };     //I guess the compiler thinks this is returning in a new empty object using the json syntax
        this._noop = this.noop;     //I would have thought this shoud definitely work
        this._noop = () =&gt; undefined;   //This does works
    }

    public noop(): void {
        //Nothing to see here...
    }
}
</code></pre>

<p>The three statements in the constructor are all intended to do the same job: initialise the member with a no operation function. However only the last statement works:</p>

<pre><code>this._noop = () =&gt; undefined; 
</code></pre>

<p>The other two statements produce the compile error.</p>

<p>Does any one know why the compiler can't seem to match the types?</p>
