Title: Compiler errors for module augmentation with export= · Issue #7130 · microsoft/TypeScript · GitHub
Open Graph Title: Compiler errors for module augmentation with export= · Issue #7130 · microsoft/TypeScript
X Title: Compiler errors for module augmentation with export= · Issue #7130 · microsoft/TypeScript
Description: TypeScript Version: nightly (1.9.0-dev.20160217) Problem Description: I've copied the following code verbatim from a baseline test file for #6742. My understanding is that this code should compile without errors, but I get two errors, wh...
Open Graph Description: TypeScript Version: nightly (1.9.0-dev.20160217) Problem Description: I've copied the following code verbatim from a baseline test file for #6742. My understanding is that this code should compile ...
X Description: TypeScript Version: nightly (1.9.0-dev.20160217) Problem Description: I've copied the following code verbatim from a baseline test file for #6742. My understanding is that this code should comp...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/7130
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Compiler errors for module augmentation with export=","articleBody":"**TypeScript Version:** \n\nnightly (1.9.0-dev.20160217)\n\n**Problem Description:**\n\nI've copied the following code verbatim from a [baseline test file](https://github.com/Microsoft/TypeScript/blob/master/tests/baselines/reference/augmentExportEquals3.js) for #6742. My understanding is that this code should compile without errors, but I get two errors, which I've indicated with comments. The output `.js` files are exactly as expected.\n\n**Code**\n\n``` ts\n\n//// [file1.ts]\nfunction foo() {}\nnamespace foo {\n export var v = 1;\n}\nexport = foo;\n\n\n//// [file2.ts]\nimport x = require(\"./file1\"); \nx.b = 1; // OK\n\ndeclare module \"./file1\" {\n interface A { a } // ERROR: Module augmentation cannot introduce new names in the top level scope\n let b: number; // ERROR: Module augmentation cannot introduce new names in the top level scope\n}\n\n\n//// [file3.ts]\nimport * as x from \"./file1\";\nimport \"./file2\";\nlet a: x.A; // OK, a's type is interface A\nlet b = x.b; // OK, b's type is number\n\n\n//// [tsconfig.json]\n{\n \"compilerOptions\": {\n \"target\": \"es6\",\n \"module\": \"amd\"\n }\n}\n\n```\n\n**Expected behavior:**\n\nNo compiler errors.\n\n**Actual behavior:** \n\nTwo compiler errors, as indicated in the code comments.\n\n**Additional info:**\n\nI also copied and compiled the [express.d.ts baseline test](https://github.com/Microsoft/TypeScript/blob/ac528cc948a3f9b81a910d133ba39092c5d3c7d8/tests/cases/compiler/augmentExportEquals5.ts), and that _does_ compile for me with no errors.\n","author":{"url":"https://github.com/yortus","@type":"Person","name":"yortus"},"datePublished":"2016-02-18T10:32:27Z","url":"https://github.com/microsoft/TypeScript/issues/7130"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a5716868-76a2-15df-0ffa-ccc476af47d3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DAAC:785A9:CC23ED:1039ACA:6B00FFF5 |
| html-safe-nonce | 75191a3befd3f0820c34cedc93fadd9b2527df3b02852efa24b12883d31d631a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQUFDOjc4NUE5OkNDMjNFRDoxMDM5QUNBOjZCMDBGRkY1IiwidmlzaXRvcl9pZCI6Ijc1MTA2OTE2ODk3ODMxNjQ5MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f04a36b35844ee73428ffa137a2daf070882240fd5896e71b3b72d10bcfc9f14 |
| hovercard-subject-tag | issue:134540135 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/7130/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a5ba93713a3af918d2a0a5552cdbcdb8ac627a63d1fbaaef3851868e29fdf2d6/microsoft/TypeScript/issues/7130 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a5ba93713a3af918d2a0a5552cdbcdb8ac627a63d1fbaaef3851868e29fdf2d6/microsoft/TypeScript/issues/7130 |
| og:image:alt | TypeScript Version: nightly (1.9.0-dev.20160217) Problem Description: I've copied the following code verbatim from a baseline test file for #6742. My understanding is that this code should compile ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yortus |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width