Title: Compiler should error when merging with a default exported declaration · Issue #3095 · microsoft/TypeScript · GitHub
Open Graph Title: Compiler should error when merging with a default exported declaration · Issue #3095 · microsoft/TypeScript
X Title: Compiler should error when merging with a default exported declaration · Issue #3095 · microsoft/TypeScript
Description: Currently if you have the following file m1.ts export default function Decl() { return 0; } export interface Decl { p1: number; p2: number; } export namespace Decl { export var x = 10; export var y = 20; interface I { } } trying to impor...
Open Graph Description: Currently if you have the following file m1.ts export default function Decl() { return 0; } export interface Decl { p1: number; p2: number; } export namespace Decl { export var x = 10; export var y...
X Description: Currently if you have the following file m1.ts export default function Decl() { return 0; } export interface Decl { p1: number; p2: number; } export namespace Decl { export var x = 10; export var y...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/3095
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Compiler should error when merging with a default exported declaration","articleBody":"Currently if you have the following file `m1.ts`\n\n``` TypeScript\nexport default function Decl() {\n return 0;\n}\n\nexport interface Decl {\n p1: number;\n p2: number;\n}\n\nexport namespace Decl {\n export var x = 10;\n export var y = 20;\n\n interface I {\n }\n}\n```\n\ntrying to import `m1.ts` with a default binding will not give you all meanings of the exported entity:\n\n``` TypeScript\nimport Entity from \"m1\"\n\nEntity();\n\nvar x: Entity; // error\nvar y: Entity.I; // error\n\nEntity.x; // error\nEntity.y; // error\n```\n\nDiscussed this with @JsonFreeman and @vladima, will try to elaborate more, but this issue should serve as a discussion point for suggestions, since there are certain interesting cases like non-exported uninstantiated namespaces.\n","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2015-05-09T03:10:10Z","url":"https://github.com/microsoft/TypeScript/issues/3095"}
| 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:ed9e79ee-e146-cbc1-3090-051651b29787 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B2EA:157C65:1E88739:28BE030:6B0176AC |
| html-safe-nonce | 8ecd1c1f35327b9a50621f10a08bdfbfd073eb843acda7c5e6ac4d6ced03cc3a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkVBOjE1N0M2NToxRTg4NzM5OjI4QkUwMzA6NkIwMTc2QUMiLCJ2aXNpdG9yX2lkIjoiODc0MTY4OTY2MTEwNzMwNDEwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2fbc104e6fa4960f6602d1e2fef9f9c5dd4db3b38861122e65167731089b5787 |
| hovercard-subject-tag | issue:74568488 |
| 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/3095/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1be9b43e25ab3d013cf25ea02ccc114fd0ede385172d38592c970141ab274ec5/microsoft/TypeScript/issues/3095 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1be9b43e25ab3d013cf25ea02ccc114fd0ede385172d38592c970141ab274ec5/microsoft/TypeScript/issues/3095 |
| og:image:alt | Currently if you have the following file m1.ts export default function Decl() { return 0; } export interface Decl { p1: number; p2: number; } export namespace Decl { export var x = 10; export var y... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielRosenwasser |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width