Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

Fix LetExpression #7

@matthias-springer

Description

@matthias-springer

The following code does not compile:

List<int> list;
list[4] = list[3]++;

Generated Java code:

dart.core.List_interface__int __tempVar_4;
int __tempVar_5;
int __tempVar_6;
void __tempVar_7;
dart.core.List_interface__int list = null;
list.operatorAtPut_List__int(4, dart._runtime.helpers.LetExpressionHelper.comma(__tempVar_4 = ((dart.core.List_interface__int) list), dart._runtime.helpers.LetExpressionHelper.comma(__tempVar_5 = 3, dart._runtime.helpers.LetExpressionHelper.comma(__tempVar_6 = __tempVar_4.operatorAt_List__int(__tempVar_5), dart._runtime.helpers.LetExpressionHelper.comma(__tempVar_7 = __tempVar_4.operatorAtPut_List__int(__tempVar_5, (__tempVar_6 + 1)), __tempVar_6)))));

This is because of how we use LetExpressionHelper at the moment.

Note: Dart code can always be rewritten in a way such that the code compiles (using extra temp variables).

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