8000 Decorators and SystemJS · Issue #3663 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content
Decorators and SystemJS #3663
Closed
Closed
@MicahZoltu

Description

@MicahZoltu
// @experimentaldecorators: true
// @emitdecoratormetadata: true
// @target: system

import { Foo } from 'foo';
declare var decorator: any;

@decorator
export class Test {
    constructor(private foo: Foo) { }
}
// ...
System.register(['foo'], function(exports_1) {
    var Foo_1;
    var Test;
    return {
        setters:[
            function (_Foo_1) {
                Foo_1 = _Foo_1;
            }],
        execute: function() {
            Test = (function () {
                function Test(foo) {
                    this.foo = foo;
                }
                Test = __decorate([
                    decorator, 
                    __metadata('design:paramtypes', [Foo])
                ], Test);
                return Test;
            })();
            exports_1("Test", Test);
        }
    }
});

The problem is with __metadata('design:paramtypes', [Foo]), at runtime Foo doesn't exist. I'm guessing Foo_1 was intended here?

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0