Skip to content

this subclass inference problem #26071

@JonathanMEdwards

Description

@JonathanMEdwards
  • VSCode Version: Code 1.12.1 (f6868fc, 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'.'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions