Skip to content

Nested record field rename doesn't update all list elements #1476

@MeiramSh

Description

@MeiramSh

Summary

Renaming nested field of the first list element would not affect other elements.

Current behavior

type alias Foo =
    { foo : Bar
    }


type alias Bar =
    { bar : Int }


fooBarList : List Foo
fooBarList =
    [ { foo = { bar = 0 } }
    , { foo = { bar = 1 } }
    ]

Renaming bar to baz on the first element or type definition would result in:

type alias Foo =
    { foo : Bar
    }


type alias Bar =
    { baz : Int }


fooBarList : List Foo
fooBarList =
    [ { foo = { baz = 0 } }
    , { foo = { bar = 1 } } -- unchanged
    ]

which is a type error.

Expected behavior

    [ { foo = { baz = 0 } }
    , { foo = { baz = 1 } } -- the second field should also be renamed
    ]

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