Title: Incorrect namespace error when generating declarations · Issue #24632 · microsoft/TypeScript · GitHub
Open Graph Title: Incorrect namespace error when generating declarations · Issue #24632 · microsoft/TypeScript
X Title: Incorrect namespace error when generating declarations · Issue #24632 · microsoft/TypeScript
Description: TypeScript Version: 3.0.0-dev.20180602 Search Terms: Cannot find namespace, declaration, TS2503 Code yarn add typescript@next yarn tsc -- src/foo.ts --declaration const Foo = { BANANA: 'banana' as 'banana', } export const Baa = { [Foo.BA...
Open Graph Description: TypeScript Version: 3.0.0-dev.20180602 Search Terms: Cannot find namespace, declaration, TS2503 Code yarn add typescript@next yarn tsc -- src/foo.ts --declaration const Foo = { BANANA: 'banana' as ...
X Description: TypeScript Version: 3.0.0-dev.20180602 Search Terms: Cannot find namespace, declaration, TS2503 Code yarn add typescript@next yarn tsc -- src/foo.ts --declaration const Foo = { BANANA: 'banana&...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/24632
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect namespace error when generating declarations","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n-->\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 3.0.0-dev.20180602\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:**\r\n\r\nCannot find namespace, declaration, TS2503\r\n\r\n**Code**\r\n\r\n```\r\nyarn add typescript@next\r\nyarn tsc -- src/foo.ts --declaration\r\n```\r\n\r\n```ts\r\nconst Foo = {\r\n BANANA: 'banana' as 'banana',\r\n}\r\n\r\nexport const Baa = {\r\n [Foo.BANANA]: 1\r\n};\r\n```\r\n\r\n\r\n**Expected behavior:**\r\n\r\nNo error. \r\n\r\n**Actual behavior:**\r\n\r\n```\r\nsrc/foo.ts:6:4 - error TS2503: Cannot find namespace 'Foo'.\r\n\r\n6 [Foo.BANANA]: 1\r\n ~~~\r\n\r\n\r\nerror Command failed with exit code 2.\r\n```\r\n\r\nOmitting the `--declaration` option results in no error.\r\nOmmiting the cast results in no error.\r\n\r\n**Playground Link:** \u003c!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior --> \r\n\r\n**Related Issues:** \r\n\r\nhttps://github.com/Microsoft/TypeScript/issues/24432\r\n","author":{"url":"https://github.com/WearyMonkey","@type":"Person","name":"WearyMonkey"},"datePublished":"2018-06-03T08:55:58Z","url":"https://github.com/microsoft/TypeScript/issues/24632"}
| 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:85bd8675-2684-b353-7c6e-40063c41ffc5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E2E6:1E6AC8:43CB3A:5F79D0:6B047086 |
| html-safe-nonce | 789ef8b843636c010bd3d7772c3bb2d7b81f880dea6f472cd9d5d9fbc8f3906a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkU2OjFFNkFDODo0M0NCM0E6NUY3OUQwOjZCMDQ3MDg2IiwidmlzaXRvcl9pZCI6IjgxMTU3NjcyMTkzMTQ3ODIzNDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ddef5e4ae2fb7fb071feb490a2cf4b48a7518840f391708442acb5ebaa6d4d9b |
| hovercard-subject-tag | issue:328811803 |
| 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/24632/issue_layout |
| twitter:image | https://opengraph.githubassets.com/13646c08d73b89e60122a6e198c17cecc20e6ebfc97dad05f60d3ada930526a0/microsoft/TypeScript/issues/24632 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/13646c08d73b89e60122a6e198c17cecc20e6ebfc97dad05f60d3ada930526a0/microsoft/TypeScript/issues/24632 |
| og:image:alt | TypeScript Version: 3.0.0-dev.20180602 Search Terms: Cannot find namespace, declaration, TS2503 Code yarn add typescript@next yarn tsc -- src/foo.ts --declaration const Foo = { BANANA: 'banana' as ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | WearyMonkey |
| hostname | github.com |
| expected-hostname | github.com |
| None | ae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f |
| 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 | cfb5f24c6e01d85f70804652a5107e5cac03a161 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width