Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReflectedDefinition on overloaded extension methods #299

Closed
Jand42 opened this issue Mar 9, 2015 · 0 comments
Closed

ReflectedDefinition on overloaded extension methods #299

Jand42 opened this issue Mar 9, 2015 · 0 comments
Labels
Milestone

Comments

@Jand42
Copy link

Jand42 commented Mar 9, 2015

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants