Skip to content

VSCode Flow uncovered code #4750

Open
Open
@thousight

Description

@thousight

I'm trying to do a type casting for my custom type inside array functions

return ((Object.values(terms).sort((t1: mixed, t2: mixed) => {
                // Cast t1 and t2 from mixed to Term
		term1 = ((t1: any): Term)
		term2 = ((t2: any): Term)
		// Sort by date
		return new Date(term1.details.startDate) - new Date(term2.details.startDate)
	}): any): Array<Term>)

However, in VSCode, it shows me blue error saying "[flow coverage] uncovered code", and I believe the way of me doing this casting is correct based on this link

Is there any way I can get rid of this error? Or is my implementation not correct? Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions