Skip to content

New rule FavourNestedFunctions #638

Open
@knocte

Description

@knocte

Testcases:

let Foo () =
    ()

let Bar () =
    ()

=> No errors

let private Foo () =
    ()

let Bar () =
    ()

=> No errors

let private Foo () =
    ()

let Bar () =
    Foo()
    ()

=> Error! (because Foo can be transformed from private to nested)

let Bar () =
    let Foo() =
        ()

    Foo()
    ()

=> no error (because Foo is nested)

let private Foo () =
    ()

let Bar () =
    Foo()
    ()

let Baz () =
    Foo ()
    ()

=> no error (because Foo is called by 2 functions: Bar and Baz; therefore, it cannot become nested)

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