<p dir="auto">TypeScript version: 1.5.3+</p>
<p dir="auto">I'm using the aurelia libraries and when I put the following decorators on properties the emitted javascript is not in the right format.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import {autoinject, bindable} from &quot;aurelia-framework&quot;;
import {Configuration} from &quot;../../../../config/config-loader&quot;;

@autoinject
export class FreedrawCustomElement {
  @bindable
  allowCreate: boolean = true;

  @bindable
  allowEdit: boolean = false;

  @bindable
  onSimulate: () =&gt; void;

  @bindable
  onEdit: Function;

  constructor(private config: Configuration) {
  }

  simulateArea() {
    if (this.onSimulate &amp;&amp; this.allowCreate) {
      this.onSimulate();
    }
  }

  editArea() {
    if (this.onEdit &amp;&amp; this.allowEdit) {
      this.onEdit();
    }
  }
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-s1">autoinject</span><span class="pl-kos">,</span> <span class="pl-s1">bindable</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"aurelia-framework"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-smi">Configuration</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"../../../../config/config-loader"</span><span class="pl-kos">;</span>

@<span class="pl-s1">autoinject</span>
<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">FreedrawCustomElement</span> <span class="pl-kos">{</span>
  @<span class="pl-s1">bindable</span>
  <span class="pl-c1">allowCreate</span>: <span class="pl-smi">boolean</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>

  @<span class="pl-s1">bindable</span>
  <span class="pl-c1">allowEdit</span>: <span class="pl-smi">boolean</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span><span class="pl-kos">;</span>

  @<span class="pl-s1">bindable</span>
  <span class="pl-c1">onSimulate</span>: <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span>

  @<span class="pl-s1">bindable</span>
  <span class="pl-c1">onEdit</span>: <span class="pl-smi">Function</span><span class="pl-kos">;</span>

  <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-k">private</span> <span class="pl-s1">config</span>: <span class="pl-smi">Configuration</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-kos">}</span>

  <span class="pl-en">simulateArea</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">onSimulate</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">allowCreate</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">onSimulate</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
  <span class="pl-kos">}</span>

  <span class="pl-en">editArea</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">onEdit</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">allowEdit</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">onEdit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The emitted JS is</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var __decorate = (this &amp;&amp; this.__decorate) || function (decorators, target, key, desc) {
    if (typeof Reflect === &quot;object&quot; &amp;&amp; typeof Reflect.decorate === &quot;function&quot;) return Reflect.decorate(decorators, target, key, desc);
    switch (arguments.length) {
        case 2: return decorators.reduceRight(function(o, d) { return (d &amp;&amp; d(o)) || o; }, target);
        case 3: return decorators.reduceRight(function(o, d) { return (d &amp;&amp; d(target, key)), void 0; }, void 0);
        case 4: return decorators.reduceRight(function(o, d) { return (d &amp;&amp; d(target, key, o)) || o; }, desc);
    }
};
var __metadata = (this &amp;&amp; this.__metadata) || function (k, v) {
    if (typeof Reflect === &quot;object&quot; &amp;&amp; typeof Reflect.metadata === &quot;function&quot;) return Reflect.metadata(k, v);
};
var aurelia_framework_1 = require(&quot;aurelia-framework&quot;);
var config_loader_1 = require(&quot;../../../../config/config-loader&quot;);
var FreedrawCustomElement = (function () {
    function FreedrawCustomElement(config) {
        this.config = config;
        this.allowCreate = true;
        this.allowEdit = false;
    }
    FreedrawCustomElement.prototype.simulateArea = function () {
        if (this.onSimulate &amp;&amp; this.allowCreate) {
            this.onSimulate();
        }
    };
    FreedrawCustomElement.prototype.editArea = function () {
        if (this.onEdit &amp;&amp; this.allowEdit) {
            this.onEdit();
        }
    };
    __decorate([
        aurelia_framework_1.bindable, 
        __metadata('design:type', Boolean)
    ], FreedrawCustomElement.prototype, &quot;allowCreate&quot;);
    __decorate([
        aurelia_framework_1.bindable, 
        __metadata('design:type', Boolean)
    ], FreedrawCustomElement.prototype, &quot;allowEdit&quot;);
    __decorate([
        aurelia_framework_1.bindable, 
        __metadata('design:type', Function)
    ], FreedrawCustomElement.prototype, &quot;onSimulate&quot;);
    __decorate([
        aurelia_framework_1.bindable, 
        __metadata('design:type', )
    ], FreedrawCustomElement.prototype, &quot;onEdit&quot;);
    FreedrawCustomElement = __decorate([
        aurelia_framework_1.autoinject, 
        __metadata('design:paramtypes', [config_loader_1.Configuration])
    ], FreedrawCustomElement);
    return FreedrawCustomElement;
})();
exports.FreedrawCustomElement = FreedrawCustomElement;
//# sourceMappingURL=freedraw.js.map"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">__decorate</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-smi">this</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">__decorate</span><span class="pl-kos">)</span> <span class="pl-c1">||</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">decorators</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">desc</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-v">Reflect</span> <span class="pl-c1">===</span> <span class="pl-s">"object"</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-k">typeof</span> <span class="pl-v">Reflect</span><span class="pl-kos">.</span><span class="pl-c1">decorate</span> <span class="pl-c1">===</span> <span class="pl-s">"function"</span><span class="pl-kos">)</span> <span class="pl-k">return</span> <span class="pl-v">Reflect</span><span class="pl-kos">.</span><span class="pl-en">decorate</span><span class="pl-kos">(</span><span class="pl-s1">decorators</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">desc</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">case</span> <span class="pl-c1">2</span>: <span class="pl-k">return</span> <span class="pl-s1">decorators</span><span class="pl-kos">.</span><span class="pl-en">reduceRight</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">o</span><span class="pl-kos">,</span> <span class="pl-s1">d</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-kos">(</span><span class="pl-s1">d</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">d</span><span class="pl-kos">(</span><span class="pl-s1">o</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c1">||</span> <span class="pl-s1">o</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-k">case</span> <span class="pl-c1">3</span>: <span class="pl-k">return</span> <span class="pl-s1">decorators</span><span class="pl-kos">.</span><span class="pl-en">reduceRight</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">o</span><span class="pl-kos">,</span> <span class="pl-s1">d</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-kos">(</span><span class="pl-s1">d</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">d</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-k">void</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">void</span> <span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-k">case</span> <span class="pl-c1">4</span>: <span class="pl-k">return</span> <span class="pl-s1">decorators</span><span class="pl-kos">.</span><span class="pl-en">reduceRight</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">o</span><span class="pl-kos">,</span> <span class="pl-s1">d</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-kos">(</span><span class="pl-s1">d</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">d</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">o</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c1">||</span> <span class="pl-s1">o</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">desc</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">__metadata</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-smi">this</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">__metadata</span><span class="pl-kos">)</span> <span class="pl-c1">||</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">k</span><span class="pl-kos">,</span> <span class="pl-s1">v</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-v">Reflect</span> <span class="pl-c1">===</span> <span class="pl-s">"object"</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-k">typeof</span> <span class="pl-v">Reflect</span><span class="pl-kos">.</span><span class="pl-c1">metadata</span> <span class="pl-c1">===</span> <span class="pl-s">"function"</span><span class="pl-kos">)</span> <span class="pl-k">return</span> <span class="pl-v">Reflect</span><span class="pl-kos">.</span><span class="pl-en">metadata</span><span class="pl-kos">(</span><span class="pl-s1">k</span><span class="pl-kos">,</span> <span class="pl-s1">v</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">aurelia_framework_1</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"aurelia-framework"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">config_loader_1</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"../../../../config/config-loader"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-v">FreedrawCustomElement</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">function</span> <span class="pl-v">FreedrawCustomElement</span><span class="pl-kos">(</span><span class="pl-s1">config</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">config</span> <span class="pl-c1">=</span> <span class="pl-s1">config</span><span class="pl-kos">;</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">allowCreate</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">allowEdit</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-v">FreedrawCustomElement</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-en">simulateArea</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">onSimulate</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">allowCreate</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">onSimulate</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>
    <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-v">FreedrawCustomElement</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-en">editArea</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">onEdit</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">allowEdit</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">onEdit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>
    <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-s1">__decorate</span><span class="pl-kos">(</span><span class="pl-kos">[</span>
        <span class="pl-s1">aurelia_framework_1</span><span class="pl-kos">.</span><span class="pl-c1">bindable</span><span class="pl-kos">,</span> 
        <span class="pl-s1">__metadata</span><span class="pl-kos">(</span><span class="pl-s">'design:type'</span><span class="pl-kos">,</span> <span class="pl-v">Boolean</span><span class="pl-kos">)</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-v">FreedrawCustomElement</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">,</span> <span class="pl-s">"allowCreate"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">__decorate</span><span class="pl-kos">(</span><span class="pl-kos">[</span>
        <span class="pl-s1">aurelia_framework_1</span><span class="pl-kos">.</span><span class="pl-c1">bindable</span><span class="pl-kos">,</span> 
        <span class="pl-s1">__metadata</span><span class="pl-kos">(</span><span class="pl-s">'design:type'</span><span class="pl-kos">,</span> <span class="pl-v">Boolean</span><span class="pl-kos">)</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-v">FreedrawCustomElement</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">,</span> <span class="pl-s">"allowEdit"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">__decorate</span><span class="pl-kos">(</span><span class="pl-kos">[</span>
        <span class="pl-s1">aurelia_framework_1</span><span class="pl-kos">.</span><span class="pl-c1">bindable</span><span class="pl-kos">,</span> 
        <span class="pl-s1">__metadata</span><span class="pl-kos">(</span><span class="pl-s">'design:type'</span><span class="pl-kos">,</span> <span class="pl-v">Function</span><span class="pl-kos">)</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-v">FreedrawCustomElement</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">,</span> <span class="pl-s">"onSimulate"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">__decorate</span><span class="pl-kos">(</span><span class="pl-kos">[</span>
        <span class="pl-s1">aurelia_framework_1</span><span class="pl-kos">.</span><span class="pl-c1">bindable</span><span class="pl-kos">,</span> 
        <span class="pl-s1">__metadata</span><span class="pl-kos">(</span><span class="pl-s">'design:type'</span><span class="pl-kos">,</span> <span class="pl-kos">)</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-v">FreedrawCustomElement</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">,</span> <span class="pl-s">"onEdit"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-v">FreedrawCustomElement</span> <span class="pl-c1">=</span> <span class="pl-s1">__decorate</span><span class="pl-kos">(</span><span class="pl-kos">[</span>
        <span class="pl-s1">aurelia_framework_1</span><span class="pl-kos">.</span><span class="pl-c1">autoinject</span><span class="pl-kos">,</span> 
        <span class="pl-s1">__metadata</span><span class="pl-kos">(</span><span class="pl-s">'design:paramtypes'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s1">config_loader_1</span><span class="pl-kos">.</span><span class="pl-c1">Configuration</span><span class="pl-kos">]</span><span class="pl-kos">)</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-v">FreedrawCustomElement</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">return</span> <span class="pl-v">FreedrawCustomElement</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">exports</span><span class="pl-kos">.</span><span class="pl-c1">FreedrawCustomElement</span> <span class="pl-c1">=</span> <span class="pl-v">FreedrawCustomElement</span><span class="pl-kos">;</span>
<span class="pl-c">//# sourceMappingURL=freedraw.js.map</span></pre></div>
<p dir="auto">If you check in the the decorator emitted for the onEdit property it haven't the value defined for the second parameter: <code class="notranslate">__metadata('design:type', )</code>. The previous decorator, on the <code class="notranslate">onSimulate</code> was emitted because it was defined as a closure type, but not the second, which was defined as a Function type.</p>
<p dir="auto">The same error occurs with <code class="notranslate">HTML*</code>, e.g. <code class="notranslate">HTMLElement</code>, types, but works with just the <code class="notranslate">Element</code> type.</p>
<p dir="auto">When I compile this code:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class A {
    constructor() { console.log('new A'); }
}

type AType = A;

function decorator(target: Object, propertyKey: string) {
}

export class B {

    @decorator
    x: AType = new A();
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'new A'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">type</span> <span class="pl-smi">AType</span> <span class="pl-c1">=</span> <span class="pl-smi">A</span><span class="pl-kos">;</span>

<span class="pl-k">function</span> <span class="pl-en">decorator</span><span class="pl-kos">(</span><span class="pl-s1">target</span>: <span class="pl-smi">Object</span><span class="pl-kos">,</span> <span class="pl-s1">propertyKey</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span>

<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">B</span> <span class="pl-kos">{</span>

    @<span class="pl-s1">decorator</span>
    <span class="pl-c1">x</span>: <span class="pl-smi">AType</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">A</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The emitter produces the following code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var A = (function () {
    function A() {
        console.log('new A');
    }
    return A;
})();
function decorator(target, propertyKey) {
}
var B = (function () {
    function B() {
        this.x = new A();
    }
    __decorate([
        decorator, 
        __metadata('design:type', Object)
    ], B.prototype, &quot;x&quot;);
    return B;
})();
exports.B = B;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-v">A</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">function</span> <span class="pl-v">A</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'new A'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-k">return</span> <span class="pl-v">A</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">decorator</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">propertyKey</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-v">B</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">function</span> <span class="pl-v">B</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">x</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">A</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-en">__decorate</span><span class="pl-kos">(</span><span class="pl-kos">[</span>
        <span class="pl-s1">decorator</span><span class="pl-kos">,</span> 
        <span class="pl-en">__metadata</span><span class="pl-kos">(</span><span class="pl-s">'design:type'</span><span class="pl-kos">,</span> <span class="pl-v">Object</span><span class="pl-kos">)</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-v">B</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">,</span> <span class="pl-s">"x"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">return</span> <span class="pl-v">B</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">exports</span><span class="pl-kos">.</span><span class="pl-c1">B</span> <span class="pl-c1">=</span> <span class="pl-v">B</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">But the expected output for metadata should be <code class="notranslate">__metadata('design:type', A)</code>. Furthermore, if I change the param declaration to <code class="notranslate">x: A = new A();</code>, the emitter will output <code class="notranslate">__metadata('design:type', )</code> (type not specified at all).</p>