Merge pull request #8994 from ethereum/fixInvertedBinaryOp

Fix type inversion for shift and exp operators.
This commit is contained in:
chriseth
2020-06-03 14:11:16 +02:00
committed by GitHub
12 changed files with 66 additions and 10 deletions
@@ -5,4 +5,3 @@ contract test {
}
}
// ----
// Warning: (99-104): Result of exponentiation has type uint8 and thus might overflow. Silence this warning by converting the literal to the expected type.
@@ -5,4 +5,3 @@ contract test {
}
}
// ----
// Warning: (99-106): Result of shift has type uint8 and thus might overflow. Silence this warning by converting the literal to the expected type.
@@ -4,4 +4,4 @@ contract test {
}
}
// ----
// TypeError: (61-77): Operator ** not compatible with types int_const 3 and ufixed128x18
// TypeError: (61-77): Operator ** not compatible with types int_const 3 and ufixed128x18. Exponent is fractional.
@@ -4,4 +4,4 @@ contract test {
}
}
// ----
// TypeError: (61-78): Operator ** not compatible with types int_const 42 and fixed128x18
// TypeError: (61-78): Operator ** not compatible with types int_const 42 and fixed128x18. Exponent is fractional.
@@ -0,0 +1,7 @@
contract test {
function f() pure public returns(uint) {
uint x = 100;
return 10 << x;
}
}
// ----
@@ -7,4 +7,4 @@ contract test {
}
}
// ----
// UnimplementedFeatureError: Not yet implemented - FixedPointType.
// TypeError: (117-123): Operator % not compatible with types rational_const 1 / 2 and fixed128x18. Fractional literals not supported.