Add more denomination tests

This commit is contained in:
Alex Beregszaszi 2018-04-23 15:04:43 +01:00
parent 6d26ad1e61
commit 75faed7c55
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,5 @@
contract C {
uint constant a = 1 wei + 2 szabo + 3 finney + 4 ether;
uint constant b = 1 seconds + 2 minutes + 3 hours + 4 days + 5 weeks + 6 years;
uint constant c = 2 szabo / 1 seconds + 3 finney * 3 hours;
}

View File

@ -0,0 +1,6 @@
contract C {
uint constant a = 4 ether / 3 hours;
ufixed constant b = ufixed(4 ether / 3 hours);
}
// ----
// TypeError: (32-49): Type rational_const 10000000000000000 / 27 is not implicitly convertible to expected type uint256. Try converting to type ufixed256x62 or use an explicit conversion.