c643f39557
eg: // @Filename: w1.ts export = Widget1 class Widget1 { name = 'one'; } // @Filename: exporter.ts export import w = require('./w1'); // @Filename: consumer.ts import e = require('./exporter'); export function w(): e.w { // Should be OK return new e.w(); } In this looking for the name of return type of function w, not just look for the alias == SymbolOfReturnType but also look for alias.exportedSymbols === symbolOfReturnType and qualify it during the toString
43 lines
902 B
JavaScript
43 lines
902 B
JavaScript
//// [tests/cases/compiler/exportImportNonInstantiatedModule2.ts] ////
|
|
|
|
//// [w1.ts]
|
|
|
|
export = Widget1
|
|
interface Widget1 { name: string; }
|
|
|
|
//// [exporter.ts]
|
|
export import w = require('./w1');
|
|
|
|
//// [consumer.ts]
|
|
import e = require('./exporter');
|
|
|
|
export function w(): e.w { // Should be OK
|
|
return {name: 'value' };
|
|
}
|
|
|
|
//// [w1.js]
|
|
define(["require", "exports"], function (require, exports) {
|
|
});
|
|
//// [exporter.js]
|
|
define(["require", "exports"], function (require, exports) {
|
|
});
|
|
//// [consumer.js]
|
|
define(["require", "exports"], function (require, exports) {
|
|
function w() {
|
|
return { name: 'value' };
|
|
}
|
|
exports.w = w;
|
|
});
|
|
|
|
|
|
//// [w1.d.ts]
|
|
export = Widget1;
|
|
interface Widget1 {
|
|
name: string;
|
|
}
|
|
//// [exporter.d.ts]
|
|
export import w = require('./w1');
|
|
//// [consumer.d.ts]
|
|
import e = require('./exporter');
|
|
export declare function w(): e.w;
|