Skip to content

Catch malformed refinement in rsc #141

@panagosg7

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;
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions