mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix #8450. Prevented internal compiler errors when assigning nested tuples.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
contract test {
|
||||
function f0() public returns(int, bool) {
|
||||
int a;
|
||||
bool b;
|
||||
((a, b)) = (2, true);
|
||||
return (a, b);
|
||||
}
|
||||
function f1() public returns(int) {
|
||||
int a;
|
||||
(((a, ), )) = ((1, 2) ,3);
|
||||
return a;
|
||||
}
|
||||
function f2() public returns(int) {
|
||||
int a;
|
||||
(((, a),)) = ((1, 2), 3);
|
||||
return a;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f0() -> 2, true
|
||||
// f1() -> 1
|
||||
// f2() -> 2
|
||||
@@ -0,0 +1,12 @@
|
||||
contract C {
|
||||
function f() {
|
||||
(((((((((((,2),)),)),),))=4)));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// SyntaxError: (15-69): No visibility specified. Did you intend to add "public"?
|
||||
// TypeError: (46-47): Expression has to be an lvalue.
|
||||
// TypeError: (60-61): Type int_const 4 is not implicitly convertible to expected type tuple(tuple(tuple(tuple(tuple(,int_const 2),),),),).
|
||||
// TypeError: (37-61): Tuple component cannot be empty.
|
||||
// TypeError: (36-62): Tuple component cannot be empty.
|
||||
// TypeError: (35-63): Tuple component cannot be empty.
|
||||
@@ -0,0 +1,6 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
int a;
|
||||
(((a,),)) = ((1,2),3);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user