mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #8994 from ethereum/fixInvertedBinaryOp
Fix type inversion for shift and exp operators.
This commit is contained in:
@@ -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.
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+7
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user