Title: Typescript hover hints show wrong types · Issue #23747 · microsoft/TypeScript · GitHub
Open Graph Title: Typescript hover hints show wrong types · Issue #23747 · microsoft/TypeScript
X Title: Typescript hover hints show wrong types · Issue #23747 · microsoft/TypeScript
Description: From Nicolas Fernandez (@burabure) on April 26, 2018 22:28 Issue Type: Bug I managed to confuse the ts language type hints, when you hover over the variables it shows a generic type, but forcing a type error on the same variable shows th...
Open Graph Description: From Nicolas Fernandez (@burabure) on April 26, 2018 22:28 Issue Type: Bug I managed to confuse the ts language type hints, when you hover over the variables it shows a generic type, but forcing a ...
X Description: From Nicolas Fernandez (@burabure) on April 26, 2018 22:28 Issue Type: Bug I managed to confuse the ts language type hints, when you hover over the variables it shows a generic type, but forcing a ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/23747
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Typescript hover hints show wrong types","articleBody":"_From @burabure on April 26, 2018 22:28_\n\nIssue Type: \u003cb>Bug\u003c/b>\r\n\r\nI managed to confuse the ts language type hints, when you hover over the variables it shows a generic type, but forcing a type error on the same variable shows the correct type on the error.\r\nThis caused a couple hours of me looking over complex types trying to figure out why it showed me a variable as a generic one.\r\n\r\n\r\n\r\nHere's the code that reproduces the error:\r\n```tsx\r\nimport React from 'react'\r\n\r\ninterface IFooProps\u003cS> {\r\n children: (state: S) => JSX.Element\r\n initialState: S,\r\n}\r\n\r\nclass Foo\u003cS extends {}> extends React.Component\u003cIFooProps\u003cS>,S> {\r\n state = this.props.initialState\r\n\r\n public render() {\r\n return \u003c>{this.props.children(this.state)}\u003c/>\r\n }\r\n}\r\n\r\ninterface IBarProps {\r\n test: 'hello',\r\n} \r\n\r\nconst Bar = (props: IBarProps) => (\r\n \u003cFoo initialState={props} >\r\n {(state) => \u003c>{state.test}\u003c/>}\r\n \u003c/Foo>\r\n)\r\n```\r\n\r\nusing these deps for example:\r\n```json\r\n{\r\n \"typescript\": \"^2.8.1\",\r\n \"react\": \"^16.3.1\",\r\n \"@types/react\": \"^16.3.12\",\r\n}\r\n```\r\n\r\nVS Code version: Code 1.22.2 (3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9, 2018-04-12T16:34:44.222Z)\r\nOS version: Linux x64 4.13.0-37-generic\r\n\r\n\u003cdetails>\r\n\u003csummary>System Info\u003c/summary>\r\n\r\n|Item|Value|\r\n|---|---|\r\n|CPUs|Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz (4 x 2593)|\r\n|Load (avg)|4, 4, 4|\r\n|Memory (System)|19.31GB (0.66GB free)|\r\n|Process Argv|/usr/share/code/code .|\r\n|Screen Reader|no|\r\n|VM|0%|\r\n\r\n\u003c/details>\u003cdetails>\u003csummary>Extensions (9)\u003c/summary>\r\n\r\nExtension|Author (truncated)|Version\r\n---|---|---\r\nBookmarks|ale|0.19.0\r\nnpm-intellisense|chr|1.3.0\r\ngithistory|don|0.4.0\r\ntslint|eg2|1.0.28\r\nprettier-vscode|esb|1.3.1\r\natom-keybindings|ms-|3.0.4\r\ndebugger-for-chrome|msj|4.3.0\r\nsnippet-creator|nik|0.0.4\r\ncode-spell-checker|str|1.6.9\r\n\r\n(2 theme extensions excluded)\r\n\r\n\u003c/details>\r\n\u003c!-- generated by issue reporter -->\n\n_Copied from original issue: Microsoft/vscode#48785_","author":{"url":"https://github.com/mjbvz","@type":"Person","name":"mjbvz"},"datePublished":"2018-04-27T21:57:23Z","url":"https://github.com/microsoft/TypeScript/issues/23747"}
| 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:c820b47c-ffe4-5e2b-250b-3ad254c4c42c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E1D2:21E3E7:E64513:130652D:6B010016 |
| html-safe-nonce | 0be22e6405cfc6a7117138c136b3d021983d6d9e75a4ab0e9e5960b42e7aa9d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMUQyOjIxRTNFNzpFNjQ1MTM6MTMwNjUyRDo2QjAxMDAxNiIsInZpc2l0b3JfaWQiOiI1NTA2Mzg3MzM1MDEwMzg1OTQyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1e11f57d17028d4c5c0c21a2baa0326168a796f9b185386bf18f60995738852b |
| hovercard-subject-tag | issue:318561424 |
| 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/23747/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2a16ce29f63101db5e4bb6c873540b064921d27f8f68a2d1d2c72c34ccd61f68/microsoft/TypeScript/issues/23747 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2a16ce29f63101db5e4bb6c873540b064921d27f8f68a2d1d2c72c34ccd61f68/microsoft/TypeScript/issues/23747 |
| og:image:alt | From Nicolas Fernandez (@burabure) on April 26, 2018 22:28 Issue Type: Bug I managed to confuse the ts language type hints, when you hover over the variables it shows a generic type, but forcing a ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mjbvz |
| 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