Skip to content

Incorrect translation of properties #7

Open
@Lexikos

Description

@Lexikos
x := y.z  ; old
x := y["z"]  ; new (incorrect)

There is no single correct syntax translation for properties, since properties are the same as associative array elements in v1. But in general, .z is more likely to be a property than an associative array/map element. Even if the original code used the object like a map (i.e. it used both y.z and y["z"]), adding [] won't be enough since the object isn't a Map. A more direct (but not recommended) translation would be to instead replace y["z"] with y.%"z"%, as both y.z and y.%"z"% refer to the same thing in v2, just as y.z and y["z"] did in v1.

Best to just leave it as is, I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions