mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Make sure "value" error hint is only displayed in the right context
Before, the hint would be shown for any "value" member, even a user-specified one.
This commit is contained in:
@@ -471,7 +471,7 @@ BOOST_AUTO_TEST_CASE(address_staticcall_value)
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(sourceCode, TypeError, "Member \"value\" not found or not visible after argument-dependent lookup");
|
||||
CHECK_ERROR(sourceCode, TypeError, "Member \"value\" is only available for payable functions.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
contract C {
|
||||
// Tests that we don't get a wrong error about constructors
|
||||
function f() public view returns (C) { return this; }
|
||||
function g() public { this.f.value(); }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (155-167): Member "value" is only available for payable functions.
|
||||
+1
-1
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (94-101): Member "value" not found or not visible after argument-dependent lookup in function (uint256) external returns (uint256) - did you forget the "payable" modifier?
|
||||
// TypeError: (94-101): Member "value" is only available for payable functions.
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ contract test {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (87-96): Member "value" not found or not visible after argument-dependent lookup in function () - did you forget the "payable" modifier?
|
||||
// TypeError: (87-96): Member "value" is only available for payable functions.
|
||||
|
||||
@@ -3,4 +3,4 @@ contract test {
|
||||
function f() public { (new receiver()).nopay.value(10)(); }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (91-119): Member "value" not found or not visible after argument-dependent lookup in function () external - did you forget the "payable" modifier?
|
||||
// TypeError: (91-119): Member "value" is only available for payable functions.
|
||||
|
||||
@@ -8,4 +8,4 @@ contract D {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (106-119): Member "value" not found or not visible after argument-dependent lookup in function () returns (contract C) - did you forget the "payable" modifier?
|
||||
// TypeError: (106-119): Constructor for contract C must be payable for member "value" to be available.
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (47-62): Member "value" not found or not visible after argument-dependent lookup in function (bytes memory) pure returns (bytes32) - did you forget the "payable" modifier?
|
||||
// TypeError: (47-62): Member "value" is only available for payable functions.
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (47-59): Member "value" not found or not visible after argument-dependent lookup in function (bytes memory) pure returns (bytes32) - did you forget the "payable" modifier?
|
||||
// TypeError: (47-59): Member "value" is only available for payable functions.
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (47-62): Member "value" not found or not visible after argument-dependent lookup in function (bytes memory) pure returns (bytes20) - did you forget the "payable" modifier?
|
||||
// TypeError: (47-62): Member "value" is only available for payable functions.
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (47-62): Member "value" not found or not visible after argument-dependent lookup in function (bytes32,uint8,bytes32,bytes32) pure returns (address) - did you forget the "payable" modifier?
|
||||
// TypeError: (47-62): Member "value" is only available for payable functions.
|
||||
|
||||
Reference in New Issue
Block a user