Disallow the years unit denomination properly

This commit is contained in:
Alex Beregszaszi
2018-06-21 20:21:02 +02:00
parent 32f2db780c
commit 72e87423db
7 changed files with 9 additions and 23 deletions
@@ -1,7 +1,6 @@
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 b = 1 seconds + 2 minutes + 3 hours + 4 days + 5 weeks;
uint constant c = 2 szabo / 1 seconds + 3 finney * 3 hours;
}
// ----
// Warning: (142-149): Using "years" as a unit denomination is deprecated.
@@ -2,4 +2,4 @@ contract C {
uint constant a = 3 years;
}
// ----
// Warning: (32-39): Using "years" as a unit denomination is deprecated.
// TypeError: (32-39): Using "years" as a unit denomination is deprecated.
@@ -1,6 +0,0 @@
pragma experimental "v0.5.0";
contract C {
uint constant a = 3 years;
}
// ----
// TypeError: (62-69): Using "years" as a unit denomination is deprecated.