Title: Ignored error in class constructor causes method usage errors to be ignored · Issue #36268 · microsoft/TypeScript · GitHub
Open Graph Title: Ignored error in class constructor causes method usage errors to be ignored · Issue #36268 · microsoft/TypeScript
X Title: Ignored error in class constructor causes method usage errors to be ignored · Issue #36268 · microsoft/TypeScript
Description: TypeScript Version: 3.5.3 Search Terms: ts-ignore in class constructor class method no error on parameter usage Code class Foo { bar: string constructor(bar: string) { this.bar = bar } baz(buzz: number) { return buzz + 1 } } // @ts-ignor...
Open Graph Description: TypeScript Version: 3.5.3 Search Terms: ts-ignore in class constructor class method no error on parameter usage Code class Foo { bar: string constructor(bar: string) { this.bar = bar } baz(buzz: nu...
X Description: TypeScript Version: 3.5.3 Search Terms: ts-ignore in class constructor class method no error on parameter usage Code class Foo { bar: string constructor(bar: string) { this.bar = bar } baz(buzz: nu...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/36268
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ignored error in class constructor causes method usage errors to be ignored","articleBody":"**TypeScript Version:** 3.5.3\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\nts-ignore in class constructor\r\nclass method no error on parameter usage\r\n\r\n**Code**\r\n\r\n```ts\r\nclass Foo {\r\n bar: string\r\n constructor(bar: string) {\r\n this.bar = bar\r\n }\r\n\r\n baz(buzz: number) {\r\n return buzz + 1\r\n }\r\n}\r\n\r\n// @ts-ignore\r\nconst instance = new Foo()\r\ninstance.baz('buzz')\r\n```\r\n\r\n**Expected behavior:**\r\nThe invocation of `instance.baz('buzz')` should report that the parameter should be a `number` instead of a `string`.\r\n\r\n**Actual behavior:**\r\nThere is no error on that line.\r\nIf I fix the ts-ignore on the line above, it then reports the error correctly.\r\n\r\n**Playground Link:** \r\nhttp://www.typescriptlang.org/play/?ts=3.8.0-dev.20200116#code/MYGwhgzhAEBiD29oG8BQ1oCMwCcBc0EALjgJYB2A5utMPOcTgK7BHw4AU2+hJFlAShQ0MRABakIAOm7QAvFlw0AvqhrYAXlyYaNBckwC2mAKY4haDBhwmiTHOSw6N0ANTQAjCtSrUAej9oAAEiCABaUkpydhNUOgYiaApiMHJgE3lochMAdzhEDgFUZKJU9JkwLQByTGcqgSA\r\n\r\n**Related Issues:** \r\nCould not find any through Google or here.\r\n","author":{"url":"https://github.com/katz12","@type":"Person","name":"katz12"},"datePublished":"2020-01-17T19:53:38Z","url":"https://github.com/microsoft/TypeScript/issues/36268"}
| 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:7f20f0ae-4132-d983-14c8-fc8f44bb2b0e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E302:358871:17259AC:1E78E3E:6B0132A5 |
| html-safe-nonce | 98f158a3a92280038e45487fec043f541e533a6b4acddaef7fa4783c8d8dd2c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzAyOjM1ODg3MToxNzI1OUFDOjFFNzhFM0U6NkIwMTMyQTUiLCJ2aXNpdG9yX2lkIjoiMTM3ODk5OTE2OTI3MjUxMTA5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 72721b5f18bae0c9f402d5215a54b341927170bdf2036a65aa71dae73d5a1641 |
| hovercard-subject-tag | issue:551602729 |
| 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/36268/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c3d23327c7b12e50442b3465cccb8aafd484cd299f654b97fa1aaf61ce6188f8/microsoft/TypeScript/issues/36268 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c3d23327c7b12e50442b3465cccb8aafd484cd299f654b97fa1aaf61ce6188f8/microsoft/TypeScript/issues/36268 |
| og:image:alt | TypeScript Version: 3.5.3 Search Terms: ts-ignore in class constructor class method no error on parameter usage Code class Foo { bar: string constructor(bar: string) { this.bar = bar } baz(buzz: nu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | katz12 |
| 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