Skip to content

ReflectedDefinition on overloaded extension methods #299

@Jand42

Description

@Jand42

Looking up reflected definition of overloaded extension methods fail at runtime.
This program is currently throwing a System.Reflection.AmbiguousMatchException:

type System.Object with
    [<ReflectedDefinition>]
    member this.Add(x) = x
    [<ReflectedDefinition>]
    member this.Add(x, y) = x + y

open FSharp.Quotations

[<EntryPoint>]
let main argv =
    match  <@ obj().Add(2) @> with
    | (Patterns.Call(_, m, _)) -> 
        m |> Expr.TryGetReflectedDefinition |> printfn "%A"
    | _ -> ()
    0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions