Skip to content

Catch malformed refinement in rsc #141

Description

@panagosg7

Wrong order of args: hasProperty prop v

/*@ sum :: (array: IArray<{ (Immutable) {[s:string]:number} | hasProperty prop v }>, prop: string) => number */
export function sum(array: any[], prop: string): number {
    let result = 0;
    for (let i = 0; i < array.length; i++) {
        result += <number>(array[i][prop]);
    }
    return result;
}

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions