Skip to content

Instantly share code, notes, and snippets.

@spion
Created October 3, 2012 13:37
Show Gist options
  • Save spion/3826945 to your computer and use it in GitHub Desktop.
Save spion/3826945 to your computer and use it in GitHub Desktop.
typescript module fail
import B = module("b");
class A extends B.B {
g(): number { return super.f(); }
};
export class B {
f():number { return 1; }
};
//577 % cat a.js var __extends = this.__extends || function (d, b) {
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
}
define(["require", "exports", "b"], function(require, exports, __B__) {
var B = __B__;
var A = (function (_super) {
__extends(A, _super);
function A() {
_super.apply(this, arguments);
}
A.prototype.g = function () {
return _super.prototype.f.call(this);
};
return A;
})(B.B);
; ;
})
//578 % cat b.js define(["require", "exports"], function(require, exports) {
var B = (function () {
function B() { }
B.prototype.f = function () {
return 1;
};
return B;
})();
exports.B = B;
; ;
})
552 % tsc a.ts --out a.js
/home/spion/Documents/tests/typescript/a.ts(1,0): Module emit collides with emitted script: /home/spion/Documents/tests/typescript/a.js
@lhk
Copy link

lhk commented Jan 11, 2013

I've got the exact same problem. Did you find a solution yet ?

@seanhess
Copy link

seanhess commented Feb 5, 2013

@lhk if you use another name for the outputted js it will compile, but it won't put anything in the file. The problem seems to be that you can't use import statements and concat all your JS with typescript. To get them to concat, you have to use tags everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment