-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
The following code
export class MyClass { }
export function myFunction() {
return new MyClass();
}
is compiled (with tsc test.ts -m system --target es2015
) to
System.register([], function(exports_1) {
"use strict";
var MyClass;
function myFunction() {
return new MyClass();
}
exports_1("myFunction", myFunction);
return {
setters:[],
execute: function() {
class MyClass {
}
exports_1("MyClass", MyClass);
}
}
});
which is wrong, since the actual definition of MyClass
is not in scope of myFunction
anymore.
Compiling down to es5 works as expected with respect to the scope of the class.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue