Skip to content

FSharMap.ComputeHashCode() throws OverflowException #6068

@jmanty

Description

@jmanty

Hash function for F# map (ComputeHashCode) ends by taking the absolute value of the combined hash values of the map's contents. If the combined hash value is Int32.MinValue, getting the absolute value fails with System.OverflowException.

Repro steps

Run following code hash <| Map.add 1073740877 1 Map.empty

Expected behavior

A hash code is returned.

Actual behavior

System.OverflowException is thrown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-LibraryIssues for FSharp.Core not covered elsewhereBug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions