Skip to content

strict function argument types #19432

Closed
Closed
@ccorcos

Description

@ccorcos

TypeScript Version: 2.5.3

Code

interface X {
	x: number
}

interface Y {
	x: number
	y: number
}


function f(x: Y) { }

const g : (x: X) => void = f

Expected behavior:

I would expect g to have an error because f can get called without the necessary y property...

Actual behavior:

...but there isnt.

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