Title: Spurious 'Index signature is missing in type' error when subclassing · Issue #1887 · microsoft/TypeScript · GitHub
Open Graph Title: Spurious 'Index signature is missing in type' error when subclassing · Issue #1887 · microsoft/TypeScript
X Title: Spurious 'Index signature is missing in type' error when subclassing · Issue #1887 · microsoft/TypeScript
Description: Hi, TS: 1.4 Not sure that I agree we should have an error here: interface Indexer { [x: string]: number } class Base { foo() : Indexer { return undefined; } } /*Error: Class 'Foo' incorrectly extends base class 'Base'. Types of property ...
Open Graph Description: Hi, TS: 1.4 Not sure that I agree we should have an error here: interface Indexer { [x: string]: number } class Base { foo() : Indexer { return undefined; } } /*Error: Class 'Foo' incorrectly exten...
X Description: Hi, TS: 1.4 Not sure that I agree we should have an error here: interface Indexer { [x: string]: number } class Base { foo() : Indexer { return undefined; } } /*Error: Class 'Foo' incorrect...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/1887
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Spurious 'Index signature is missing in type' error when subclassing","articleBody":"Hi,\n\n**TS**: 1.4\n\nNot sure that I agree we should have an error here:\n\n``` typeScript\ninterface Indexer {\n [x: string]: number\n}\n\nclass Base {\n\n foo() : Indexer {\n return undefined;\n }\n}\n\n/*Error: Class 'Foo' incorrectly extends base class 'Base'.\n Types of property 'foo' are incompatible.\n Type '() => { id: number; }' is not assignable to type '() => Indexer'.\n Type '{ id: number; }' is not assignable to type 'Indexer'.\n Index signature is missing in type '{ id: number; }'.\n*/ \nclass Foo extends Base {\n\n foo() {\n return { id: 10 };\n }\n}\n```\n","author":{"url":"https://github.com/NoelAbrahams","@type":"Person","name":"NoelAbrahams"},"datePublished":"2015-02-02T13:23:50Z","url":"https://github.com/microsoft/TypeScript/issues/1887"}
| 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:271b627e-c020-2bca-bf9c-c7f9291c2f02 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BDB2:361639:FB2211:14F549B:6B011232 |
| html-safe-nonce | 5dcb0de00e8a75f4210f0d30aef4ec62b9ff18b038d2e15cd38888d378345a7f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREIyOjM2MTYzOTpGQjIyMTE6MTRGNTQ5Qjo2QjAxMTIzMiIsInZpc2l0b3JfaWQiOiI3NDYyODI5MTQ1NDY3MTk1OTU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6b90136aa4c3b4742527a25e713247d7c14a9cc43156af734f59f67d80a7310a |
| hovercard-subject-tag | issue:56236067 |
| 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/1887/issue_layout |
| twitter:image | https://opengraph.githubassets.com/48822d0c9f122613d7954e9a439b67caed70f675388e4b1eb8c5cf2ec90031b7/microsoft/TypeScript/issues/1887 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/48822d0c9f122613d7954e9a439b67caed70f675388e4b1eb8c5cf2ec90031b7/microsoft/TypeScript/issues/1887 |
| og:image:alt | Hi, TS: 1.4 Not sure that I agree we should have an error here: interface Indexer { [x: string]: number } class Base { foo() : Indexer { return undefined; } } /*Error: Class 'Foo' incorrectly exten... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NoelAbrahams |
| 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