Title: Type comparison incorrect with inherited string literals · Issue #13985 · microsoft/TypeScript · GitHub
Open Graph Title: Type comparison incorrect with inherited string literals · Issue #13985 · microsoft/TypeScript
X Title: Type comparison incorrect with inherited string literals · Issue #13985 · microsoft/TypeScript
Description: TypeScript Version: 2.2.0 Code class Foo { bar: "boop"; } class Buzz extends Foo { bar = 'boop' } Playground Link Expected behavior: Compiles without error. Actual behavior: Class 'Buzz' incorrectly extends base class 'Foo'. Types of pro...
Open Graph Description: TypeScript Version: 2.2.0 Code class Foo { bar: "boop"; } class Buzz extends Foo { bar = 'boop' } Playground Link Expected behavior: Compiles without error. Actual behavior: Class 'Buzz' incorrectl...
X Description: TypeScript Version: 2.2.0 Code class Foo { bar: "boop"; } class Buzz extends Foo { bar = 'boop' } Playground Link Expected behavior: Compiles without error. Actual behavior: Class...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/13985
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Type comparison incorrect with inherited string literals","articleBody":"**TypeScript Version:** 2.2.0\r\n\r\n**Code**\r\n\r\n```ts\r\nclass Foo {\r\n bar: \"boop\";\r\n}\r\nclass Buzz extends Foo {\r\n bar = 'boop'\r\n}\r\n```\r\n\r\n[Playground Link](https://www.typescriptlang.org/play/index.html#src=class%20Foo%20%7B%0D%0A%20%20%20%20bar%3A%20%22boop%22%3B%0D%0A%7D%0D%0A%0D%0Aclass%20Buzz%20extends%20Foo%20%7B%0D%0A%20%20%20%20bar%20%3D%20'boop'%0D%0A%7D%0D%0A)\r\n\r\n**Expected behavior:**\r\n\r\nCompiles without error.\r\n\r\n**Actual behavior:**\r\n\r\n```\r\nClass 'Buzz' incorrectly extends base class 'Foo'.\r\n Types of property 'bar' are incompatible.\r\n Type 'string' is not assignable to type '\"boop\"'.\r\n```\r\n\r\n----\r\n\r\nApologies if I'm missing something obvious, this is by design, or there are existing issues for this. I searched and didn't find anything like it.","author":{"url":"https://github.com/davewasmer","@type":"Person","name":"davewasmer"},"datePublished":"2017-02-09T23:30:45Z","url":"https://github.com/microsoft/TypeScript/issues/13985"}
| 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:83a8a47d-06d0-ff45-62f4-48f133c9efea |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C038:1EC9BC:C63743:FDB9A3:6B010007 |
| html-safe-nonce | 681dd0adec03c11dd1634f9d1b24f44ed191f3e96e61f3eb92d6b3a458d5652d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDM4OjFFQzlCQzpDNjM3NDM6RkRCOUEzOjZCMDEwMDA3IiwidmlzaXRvcl9pZCI6IjgyNDc2MjIxNTE2MzgyMjA4OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 43b06c27888f0f7374cff0273c6faa6dcaac367237047bd0b70b70b05e71ac41 |
| hovercard-subject-tag | issue:206662040 |
| 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/13985/issue_layout |
| twitter:image | https://opengraph.githubassets.com/19d14aa19a7926785b28d94de7298d291328b5892de3d28c5f45794e4df5bb94/microsoft/TypeScript/issues/13985 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/19d14aa19a7926785b28d94de7298d291328b5892de3d28c5f45794e4df5bb94/microsoft/TypeScript/issues/13985 |
| og:image:alt | TypeScript Version: 2.2.0 Code class Foo { bar: "boop"; } class Buzz extends Foo { bar = 'boop' } Playground Link Expected behavior: Compiles without error. Actual behavior: Class 'Buzz' incorrectl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | davewasmer |
| 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