mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Restrict mobile types of function types.
Move ternary tests to semanticTests
This commit is contained in:
committed by
Nikola Matic
parent
2c82873a2c
commit
110e2a656d
@@ -0,0 +1,10 @@
|
||||
contract C {
|
||||
event MyCustomEvent(uint);
|
||||
function f() pure public {
|
||||
true ? MyCustomEvent : MyCustomEvent;
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError 9717: (90-103): Invalid mobile type in true expression.
|
||||
// TypeError 3703: (106-119): Invalid mobile type in false expression.
|
||||
@@ -1,17 +0,0 @@
|
||||
contract C {
|
||||
event MyCustomEvent(uint);
|
||||
event MyCustomEvent2(uint);
|
||||
event MyCustomEvent3(uint, bool);
|
||||
function f() pure public {
|
||||
true ? MyCustomEvent : MyCustomEvent;
|
||||
true ? MyCustomEvent : MyCustomEvent2;
|
||||
true ? MyCustomEvent : MyCustomEvent3;
|
||||
true ? MyCustomEvent : true;
|
||||
true ? true : MyCustomEvent;
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError 1080: (246-283): True expression's type event MyCustomEvent(uint256) does not match false expression's type event MyCustomEvent3(uint256,bool).
|
||||
// TypeError 1080: (293-320): True expression's type event MyCustomEvent(uint256) does not match false expression's type bool.
|
||||
// TypeError 1080: (330-357): True expression's type bool does not match false expression's type event MyCustomEvent(uint256).
|
||||
Reference in New Issue
Block a user