Created
December 17, 2013 14:40
-
-
Save Tarmil/8005892 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open IntelliFactory.WebSharper | |
open Microsoft.FSharp | |
let hasRefDef (t: System.Type) = | |
match t.GetMethods() |> Seq.find (fun m -> m.Name = "get_Body") with | |
| Quotations.DerivedPatterns.MethodWithReflectedDefinition d -> true | |
| _ -> false | |
type Foo() = | |
inherit Web.Control() | |
[<JavaScript>] | |
override this.Body = Text "" | |
let Bar = | |
{ new Web.Control() with | |
[<JavaScript>] member this.Body = Text "" } | |
hasRefDef typeof<Foo> // true | |
hasRefDef (Bar.GetType()) // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment