Title: Allow stricter structural typing · Issue #391 · microsoft/TypeScript · GitHub
Open Graph Title: Allow stricter structural typing · Issue #391 · microsoft/TypeScript
X Title: Allow stricter structural typing · Issue #391 · microsoft/TypeScript
Description: Say I have the following: interface Options { doSomethingSpecial?: boolean } function configure(options: Options) {} configure({}); The preceding (correctly) does not flag any issues. However, say I change the function call to: configure...
Open Graph Description: Say I have the following: interface Options { doSomethingSpecial?: boolean } function configure(options: Options) {} configure({}); The preceding (correctly) does not flag any issues. However, say ...
X Description: Say I have the following: interface Options { doSomethingSpecial?: boolean } function configure(options: Options) {} configure({}); The preceding (correctly) does not flag any issues. However, say ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/391
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow stricter structural typing","articleBody":"Say I have the following:\n\n```\ninterface Options {\n doSomethingSpecial?: boolean\n}\n\nfunction configure(options: Options) {}\nconfigure({});\n```\n\nThe preceding (correctly) does not flag any issues. However, say I change the function call to:\n\n```\nconfigure({doSomethingSuper: true});\n```\n\nThis also does not flag any issues. I understand that in many (most?) cases this is the desired behavior, but in other cases it seems that a stricter matching (ie, you don't have to specify \"doSomethingSpecial\" but you can't specify anything else either) would be desirable. There are at least two instances that I can think of where this applies:\n\n1) Catching typos\n2) (more importantly) Compile-time checking after a refactoring of \"doSomethingSpecial\" to be named something else\n\nPerhaps some new syntax for enabling this mode would be useful. For example:\n\n```\nfunction configure(options: Options!) {}\n```\n","author":{"url":"https://github.com/jbrantly","@type":"Person","name":"jbrantly"},"datePublished":"2014-08-07T18:02:17Z","url":"https://github.com/microsoft/TypeScript/issues/391"}
| 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:0ed8e219-ae3c-90e6-6279-8ac3372b580a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DE4:322768:149CD3:1C4ACC:6AFBFC56 |
| html-safe-nonce | 76af6df1a26dc4075229b1bf0b68638d34eb8d4b4c1fe3c29d07ea24d4241a83 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REU0OjMyMjc2ODoxNDlDRDM6MUM0QUNDOjZBRkJGQzU2IiwidmlzaXRvcl9pZCI6IjQzMDM0NDUyMjgyMjk3NTM5NDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 74cbbee83941d3f5b075b27236b4cec474f1c4f0f53ce35bd2d4e73fda1cab24 |
| hovercard-subject-tag | issue:39751620 |
| 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/391/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ef3b381b5c18369c83b941bcbb36590c0bc5bcbd9f9314e1fe87b1cae16eea74/microsoft/TypeScript/issues/391 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ef3b381b5c18369c83b941bcbb36590c0bc5bcbd9f9314e1fe87b1cae16eea74/microsoft/TypeScript/issues/391 |
| og:image:alt | Say I have the following: interface Options { doSomethingSpecial?: boolean } function configure(options: Options) {} configure({}); The preceding (correctly) does not flag any issues. However, say ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jbrantly |
| hostname | github.com |
| expected-hostname | github.com |
| None | fa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f |
| 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 | b3b5633a74535d9c23385512d534c66c8fde1907 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width