Skip to content

Partials accept functions #17003

Closed
Closed
@luke-john

Description

@luke-john

TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)

2.4.1 and 2.5.0-dev.20170629 and 2.5.0-dev.20170707

Code

interface Foo {
    cat: string
    bar: number
}

type Bar = Partial<Foo>

const notBar: Bar = () => { } // passes on 2.4.1 and 2.5.0-dev.20170629 and 2.5.0-dev.20170707

Expected behavior:

Partials should not accept functions

Actual behavior:

Partials accept functions

typescript-playground-example

Related Issues:

13132 has been marked as a duplicate of 7485 which has been closed

7485 is meant was meant to be closed by 16047 which has merged.

Edit: updated after testing on latest nightly and simplified example code

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