Skip to content

Weird type-widening issue when using methods instead of function properties. #6309

Closed
@srijs

Description

@srijs

Hi there.

I'm using the tsc compiler, version 1.8.0-dev.20151231, and I'm running into a weird issue where widening of structural types works when I'm defining a class with a function property, and fails when I'm replacing that function property by a "proper" method.

But see for yourself: This is the version that compiles, and this is the version that doesn't.

What is the difference here? Is this a bug in the type inference engine?

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions