Skip to content

Overload resolution does not prefer method that would need less conversions #14318

Open
@NinoFloris

Description

@NinoFloris

Found in #14302

type M() =
    static member A(m: int64 array, n: int64) = 1
    static member A(m: System.ReadOnlySpan<int64>, n: int64) = 2

let test() = M.A([|10L|], 1)

I would say we should prefer the first overload here instead of failing with an overload error.

https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0AbEAzAzgHwBcBPABxgAIBZACgEoKBeAWACgKOLdCBDQgSzAUAtjGHAYUCgEEawkBX4A7Qqgo8oUHsTQUlC5apQNGFAIxtOXXgKGjxkmXIUBlYtzEA6AEoweAEwB5JQxiF1IeJQAeQ1QAPl19RRVUEwoAJjY2DBhCCkIYbnomak9ZAG18MwAGABl8AF1dMzogA=

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions