Skip to content

TS not indicating type missmatches #12914

@glazar

Description

@glazar

TypeScript Version: 2.1.1 / nightly (2.2.0-dev.201xxxxx)

Code

interface Input {
  text?: string;
}

const test = (input: Input): string => {
  return "";
};

test("test");

Expected behavior:
Type mismatch indicated.
It works if I make the Input Interface text member non-optional.
Actual behavior:
No type mismatch indicated.
It works if I make the Input Interface text member non-optional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions