Skip to content

Doesn't work type checking for function argumentsΒ #11058

Closed
@iKBAHT

Description

@iKBAHT

TypeScript Version: 1.8.0 / nightly (2.0.0-dev.201xxxxx)

Code

function fn(options: { a?: number, b?: boolean }) {
    return options.a || 1;  
}

fn('foo');

Expected behavior:
Must be an error in

fn('foo');

Actual behavior:
No errors, TS compiler say "OK".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design LimitationConstraints of the existing architecture prevent this from being fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions