mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add tests for literal operations as well.
This commit is contained in:
parent
daa69df447
commit
932915633b
@ -0,0 +1,5 @@
|
|||||||
|
contract C {
|
||||||
|
uint constant a = 1 / 0;
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError: (35-40): Operator / not compatible with types int_const 1 and int_const 0
|
@ -0,0 +1,5 @@
|
|||||||
|
contract C {
|
||||||
|
uint constant a = 1 / ((1+3)-4);
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError: (35-48): Operator / not compatible with types int_const 1 and int_const 0
|
@ -0,0 +1,5 @@
|
|||||||
|
contract C {
|
||||||
|
uint constant b3 = 1 % 0;
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError: (36-41): Operator % not compatible with types int_const 1 and int_const 0
|
@ -0,0 +1,5 @@
|
|||||||
|
contract C {
|
||||||
|
uint constant b3 = 1 % (-4+((2)*2));
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError: (36-52): Operator % not compatible with types int_const 1 and int_const 0
|
Loading…
Reference in New Issue
Block a user