File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
test/libsolidity/syntaxTests/tupleAssignments Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Compiler Features:
10
10
11
11
12
12
Bugfixes:
13
+ * Type Checker: Fix internal compiler error on tuple assignments with invalid left-hand side.
13
14
14
15
15
16
### 0.8.16 (2022-08-08)
Original file line number Diff line number Diff line change @@ -166,8 +166,15 @@ void TypeChecker::checkDoubleStorageAssignment(Assignment const& _assignment)
166
166
);
167
167
}
168
168
};
169
+
170
+ TupleExpression const * lhsTupleExpression = dynamic_cast <TupleExpression const *>(&_assignment.leftHandSide ());
171
+ if (!lhsTupleExpression)
172
+ {
173
+ solAssert (m_errorReporter.hasErrors ());
174
+ return ;
175
+ }
169
176
count (
170
- dynamic_cast <TupleExpression const &>(_assignment. leftHandSide ()) ,
177
+ *lhsTupleExpression ,
171
178
dynamic_cast <TupleType const &>(*type (_assignment.rightHandSide ())),
172
179
count
173
180
);
Original file line number Diff line number Diff line change
1
+ contract C {
2
+ function f () internal pure {}
3
+ function g () internal pure returns (uint256 ) {}
4
+ function h () internal pure returns (uint256 , uint256 ) {}
5
+ function test () public pure {
6
+ f () = ();
7
+ g () = (uint256 (1 ));
8
+ h () = (uint256 (1 ), uint256 (2 ));
9
+ h () = ();
10
+ }
11
+ }
12
+ // ----
13
+ // TypeError 4247: (184-187): Expression has to be an lvalue.
14
+ // TypeError 4247: (196-199): Expression has to be an lvalue.
15
+ // TypeError 4247: (218-221): Expression has to be an lvalue.
16
+ // TypeError 4247: (252-255): Expression has to be an lvalue.
17
+ // TypeError 7407: (258-260): Type tuple() is not implicitly convertible to expected type tuple(uint256,uint256).
You can’t perform that action at this time.
0 commit comments