Skip to content

I hope the type checker to report an error when I call a function which return never. #37747

@zhuobinggang

Description

@zhuobinggang

For example:

class OpenBox implements Box{
  open(): never{
    throw "No I should not call this method"
  }
  close(): CloseBox{
    return new CloseBox();
  }
}

new OpenBox().open() // I want the type checker to report an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions