Skip to content

(rosetta) type inference is not sufficiently narrowed causing incorrect Python translations #3029

@nija-at

Description

@nija-at

🐛 Bug Report

Given the method signature -

mymethod(props: any);

and the snippet that uses this method as -

mymethod({
   Foo: 'Bar',
   Baz: 5
});

This gets incorrectly translated into Python as -

mymethod(
  Foo="Bar",
  Baz=5
)

Real life example -

================= 95964378aeaa3097f169ababbfa7299d423f35d782742e0b6ef0ec429f7e6e7e =================
template.hasResourceProperties('Foo::Bar', {
  Foo: 'Bar',
  Baz: 5,
  Qux: [ 'Waldo', 'Fred' ],
});
----------- python -----------
template.has_resource_properties("Foo::Bar",
    Foo="Bar",
    Baz=5,
    Qux=["Waldo", "Fred"]
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.effort/mediumMedium work item – a couple days of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions