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

Fix LetExpression #7

Open
matthias-springer opened this issue Oct 3, 2016 · 0 comments
Open

Fix LetExpression #7

matthias-springer opened this issue Oct 3, 2016 · 0 comments

Comments

@matthias-springer
Copy link
Contributor

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant