-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Emitter] Wrong design:type metadata for decorated fields #4364
Comments
i think i'm running into the same issue here: import {bindable} from 'aurelia-framework';
gets translated to:
|
This is by design. the intended behavior is not doable for the general case. one thing to keep in mind is we are serializing the type using the constructor function. if you alias it, the constructor function might not be, and probably is not, in scope. consider this: // a.ts
class A {
}
export type TypeA = A;
export function getA() { return new A(); } and // b.ts
import {AType, getA} from "a";
export class B {
@decorator
x: AType = getA(); // 'A' is not in scope here, the value will be undefined.
} Solutions, either you use |
@fopsdev this is a different issue. |
…ext of synthesized node Fixes #4364
@mhegazy what about @fopsdev issue? can't find created bug ;( im stuck with this bug too =
produces
|
When I compile this code:
The emitter produces the following code:
But the expected output for metadata should be
__metadata('design:type', A)
. Furthermore, if I change the param declaration tox: A = new A();
, the emitter will output__metadata('design:type', )
(type not specified at all).The text was updated successfully, but these errors were encountered: