Skip to content

Disable "shadowing" of methods? #24

Description

@HLWeil

Given the following class

type Person(name : string) =
    
    inherit DynamicObj()

    let mutable name = name

    member this.Name
        with get() = name
        and set(value) = name <- value

    member this.Walk () = printfn "%s is walking" name

You can currently set a dynamic property with the same name as an existing method.

let p = Person("John")

p.SetValue("Walk", "Shadowing")

p.Walk() // John is walking

p.GetValue("Walk") // val it: obj = "Shadowing"

Should this work, or fail? @kMutagene

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions