builtin_overloaded.sol 441 B

1234567891011121314151617
  1. contract C {
  2. bytes constant bs = "abcdefgh";
  3. int8 constant v = bs.readInt8(0);
  4. function test1() public {
  5. bs.readInt8("foo");
  6. }
  7. function test2() public {
  8. bs.readInt8(1, "foo");
  9. }
  10. }
  11. // ---- Expect: diagnostics ----
  12. // error: 3:20-34: cannot call function in constant expression
  13. // error: 6:15-20: implicit conversion to uint32 from bytes3 not allowed
  14. // error: 10:6-14: builtin function 'readInt8' expects 1 arguments, 2 provided