Skip to content

(regressions) Property 'something' does not exist on type '{}' and Types of parameters 'field' and 'value' are incompatible#18941

@pocesar

Description

@pocesar

TypeScript Version: nightly (2.6.0-dev.20171004)

Code

Many things broke (on unchanged code) when using lodash type definitions with latest nightly. The inferring is kinda broken (and it's not allowing parameters to be overloaded)

Expected behavior:

To work:

[].forEach((field: keyofData.AddressDataSetMixin)=>{//...})//..._.reduce(citizens,(name,citizen)=>{if(citizen.address&&citizen.address.id===address.id){returncitizen.name}return''},'')//...constfindBase=(field: string)=>{return_.find(definitions,(def)=>def.field===field)!.id}

Actual behavior:

Doesnt:

[].forEach((field: keyofData.AddressDataSetMixin)=>{//.../*[ts]Argument of type '(field: "number" | "id" | "name" | "date" | "type" | "street" | "full" | "picture" | "cadastrador...' is not assignable to parameter of type '(value: string, index: number, array: string[]) => void'. Types of parameters 'field' and 'value' are incompatible. Type 'string' is not assignable to type '"number" | "id" | "name" | "date" | "type" | "street" | "full" | "picture" | "cadastrador" | "las...'. */})//..._.reduce(citizens,(name,citizen)=>{/*Argument of type '(name: string, citizen: RemoteArrayProxy<CitizenDataSet>) => string | undefined' is not assignable to parameter of type 'MemoIterator<RemoteArrayProxy<CitizenDataSet>, string | undefined>'. Types of parameters 'name' and 'prev' are incompatible. Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'.'*/if(citizen.address&&citizen.address.id===address.id){returncitizen.name}return''},'')// ...constfindBase=(field: string)=>{/* Property 'field' does not exist on type '{}' */return_.find(definitions,(def)=>def.field===field)!.id}

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