Skip to content

Disable "shadowing" of methods? #24

@HLWeil

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions