mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Test cases for when default temp var is inserted for export default in the declaration file
This commit is contained in:
parent
68bdbe04e7
commit
75ef6772bf
@ -0,0 +1,19 @@
|
||||
//// [pi.ts]
|
||||
export default 3.14159;
|
||||
|
||||
//// [pi.js]
|
||||
System.register([], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters:[],
|
||||
execute: function() {
|
||||
exports_1("default",3.14159);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//// [pi.d.ts]
|
||||
declare var _default: number;
|
||||
export default _default;
|
||||
@ -0,0 +1,3 @@
|
||||
=== tests/cases/compiler/pi.ts ===
|
||||
export default 3.14159;
|
||||
No type information for this code.
|
||||
@ -0,0 +1,3 @@
|
||||
=== tests/cases/compiler/pi.ts ===
|
||||
export default 3.14159;
|
||||
No type information for this code.
|
||||
@ -0,0 +1,38 @@
|
||||
//// [pi.ts]
|
||||
|
||||
export default 3.14159;
|
||||
|
||||
//// [app.js]
|
||||
System.register("pi", [], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters:[],
|
||||
execute: function() {
|
||||
exports_1("default",3.14159);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//// [app.d.ts]
|
||||
declare module "pi" {
|
||||
declare var _default: number;
|
||||
export default _default;
|
||||
}
|
||||
|
||||
|
||||
//// [DtsFileErrors]
|
||||
|
||||
|
||||
app.d.ts(2,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
|
||||
|
||||
|
||||
==== app.d.ts (1 errors) ====
|
||||
declare module "pi" {
|
||||
declare var _default: number;
|
||||
~~~~~~~
|
||||
!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context.
|
||||
export default _default;
|
||||
}
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/pi.ts ===
|
||||
|
||||
No type information for this code.export default 3.14159;
|
||||
No type information for this code.
|
||||
@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/pi.ts ===
|
||||
|
||||
No type information for this code.export default 3.14159;
|
||||
No type information for this code.
|
||||
@ -0,0 +1,4 @@
|
||||
// @declaration: true
|
||||
// @module: system
|
||||
// @Filename: pi.ts
|
||||
export default 3.14159;
|
||||
@ -0,0 +1,6 @@
|
||||
// @declaration: true
|
||||
// @module: system
|
||||
// @outFile: app.js
|
||||
|
||||
// @Filename: pi.ts
|
||||
export default 3.14159;
|
||||
Loading…
x
Reference in New Issue
Block a user