Title: Regression bug - false typescript error with regards to generics and generics inference · Issue #28445 · microsoft/TypeScript · GitHub
Open Graph Title: Regression bug - false typescript error with regards to generics and generics inference · Issue #28445 · microsoft/TypeScript
X Title: Regression bug - false typescript error with regards to generics and generics inference · Issue #28445 · microsoft/TypeScript
Description: Issue Type: Bug I use a complex structure of classes, interfaces and generics. The generic type is inferred by the first paramter of the class constructor. In the current version I get a syntax highlight error that I did not receive in o...
Open Graph Description: Issue Type: Bug I use a complex structure of classes, interfaces and generics. The generic type is inferred by the first paramter of the class constructor. In the current version I get a syntax hig...
X Description: Issue Type: Bug I use a complex structure of classes, interfaces and generics. The generic type is inferred by the first paramter of the class constructor. In the current version I get a syntax hig...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/28445
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression bug - false typescript error with regards to generics and generics inference","articleBody":"\r\nIssue Type: \u003cb>Bug\u003c/b>\r\n\r\nI use a complex structure of classes, interfaces and generics.\r\n\r\nThe generic type is inferred by the first paramter of the class constructor.\r\nIn the current version I get a syntax highlight error that I did not receive in older versions (few month ago).\r\n\r\nHere are some screenshots - and the code is below:\r\n\r\n\r\nAnd the errors are:\r\n\r\nand:\r\n\r\n\r\n\r\n\r\nHere's the type script code with two members - one that get's the syntax error and one that works.\r\n\r\n class ClassA\u003cclassType> {\r\n constructor(private entity?: classType, public settings?: SettingsInterface\u003cclassType>) {\r\n\r\n }\r\n }\r\n export interface valueInterface\u003cclassType> {\r\n func?: (row: classType) => any;\r\n value?: string;\r\n }\r\n export interface SettingsInterface\u003cclassType> {\r\n values?: (row: classType) => valueInterface\u003cclassType>[],\r\n }\r\n class myClass{\r\n theName='myClass';\r\n }\r\n\r\n var thisGetsTheFalseError = new ClassA(new myClass(), {\r\n values: o => [\r\n {\r\n value: o.theName,\r\n func: x => 'asdfkjhgfdfghjkjhgfdfghjklkjhgfdfghjklkjhgfghj'\r\n }\r\n ]\r\n });\r\n var thisIsOk = new ClassA\u003cmyClass>(new myClass(), {\r\n values: o => [\r\n {\r\n value: o.theName,\r\n func: x => 'asdfkjhgfdfghjkjhgfdfghjklkjhgfdfghjklkjhgfghj'\r\n }\r\n ]\r\n });\r\n\r\n\r\nVS Code version: Code 1.28.2 (7f3ce96ff4729c91352ae6def877e59c561f4850, 2018-10-17T00:23:51.859Z)\r\nOS version: Windows_NT x64 10.0.17134\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-5930K CPU @ 3.50GHz (12 x 3500)|\r\n|GPU Status|2d_canvas: enabled\u003cbr>checker_imaging: disabled_off\u003cbr>flash_3d: enabled\u003cbr>flash_stage3d: enabled\u003cbr>flash_stage3d_baseline: enabled\u003cbr>gpu_compositing: enabled\u003cbr>multiple_raster_threads: enabled_on\u003cbr>native_gpu_memory_buffers: disabled_software\u003cbr>rasterization: enabled\u003cbr>video_decode: enabled\u003cbr>video_encode: enabled\u003cbr>webgl: enabled\u003cbr>webgl2: enabled|\r\n|Memory (System)|31.84GB (17.33GB free)|\r\n|Process Argv|--folder-uri file:///c%3A/Repos/radweb|\r\n|Screen Reader|no|\r\n|VM|0%|\r\n\r\n\u003c/details>\u003cdetails>\u003csummary>Extensions (4)\u003c/summary>\r\n\r\nExtension|Author (truncated)|Version\r\n---|---|---\r\nng-template|Ang|0.1.10\r\ngithistory|don|0.4.3\r\ngitlens|eam|8.5.6\r\ndebugger-for-chrome|msj|4.11.0\r\n\r\n\r\n\u003c/details>\r\n\u003c!-- generated by issue reporter -->","author":{"url":"https://github.com/noam-honig","@type":"Person","name":"noam-honig"},"datePublished":"2018-11-09T07:53:56Z","url":"https://github.com/microsoft/TypeScript/issues/28445"}
| 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:db6486d6-09f1-bb7d-848e-85b9966ecebd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 91A0:2D40DE:2152B6D:2A6D3CD:6B01B4FA |
| html-safe-nonce | 69deb82a40230911112be86871a03186e8062f5295e455d5ffd79d334572325c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUEwOjJENDBERToyMTUyQjZEOjJBNkQzQ0Q6NkIwMUI0RkEiLCJ2aXNpdG9yX2lkIjoiODIxMjk4ODM4MjQ5NDcwMDc5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1abc92406616af57c8a935828abbd6359ad9b22768e14669a315ce511867f555 |
| hovercard-subject-tag | issue:379302674 |
| 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/28445/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b530986b09235c5f50d9fc29d229055f055518556954a3d8c878820ebc471652/microsoft/TypeScript/issues/28445 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b530986b09235c5f50d9fc29d229055f055518556954a3d8c878820ebc471652/microsoft/TypeScript/issues/28445 |
| og:image:alt | Issue Type: Bug I use a complex structure of classes, interfaces and generics. The generic type is inferred by the first paramter of the class constructor. In the current version I get a syntax hig... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | noam-honig |
| 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