Skip to content

this subclass inference problem #15615

Closed
@mjbvz

Description

@mjbvz

From @JonathanMEdwards on May 5, 2017 19:19

  • VSCode Version: Code 1.12.1 (f6868fce3eeb16663840eb82123369dec6077a9b, 2017-05-04T21:18:32.269Z)
  • OS Version: Darwin x64 16.5.0
  • Extensions:
Extension Author Version
ExtensionUpdateCheck HookyQR 0.0.2
vscode-npm-script eg2 0.1.9
auto-close-tag formulahendry 0.3.12
backspace-plusplus jrieken 0.0.15
Theme-MaterialKit ms-vscode 0.1.4
debugger-for-chrome msjsdiag 3.1.1
theme-black-plus none 0.0.1
theme-visualstudio black none 0.0.1

Steps to Reproduce:

class A {
  foo = 0;
  method() {
    if (this instanceof B) {
      this.foo;
    } else {
      this.foo;
    }
  }
}
class B extends A {
}

Produces error:

'Property 'foo' does not exist on type 'never'.'

Copied from original issue: microsoft/vscode#26071

Metadata

Metadata

Assignees

Labels

FixedA PR has been merged for this issueNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions