mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Rename .sig to .selector on function types
This commit is contained in:
@@ -10056,16 +10056,16 @@ BOOST_AUTO_TEST_CASE(function_types_sig)
|
||||
char const* sourceCode = R"(
|
||||
contract C {
|
||||
function f() returns (bytes4) {
|
||||
return this.f.sig;
|
||||
return this.f.selector;
|
||||
}
|
||||
function g() returns (bytes4) {
|
||||
function () external returns (bytes4) fun = this.f;
|
||||
return fun.sig;
|
||||
return fun.selector;
|
||||
}
|
||||
function h() returns (bytes4) {
|
||||
function () external returns (bytes4) fun = this.f;
|
||||
var funvar = fun;
|
||||
return funvar.sig;
|
||||
return funvar.selector;
|
||||
}
|
||||
}
|
||||
)";
|
||||
|
||||
@@ -6290,34 +6290,34 @@ BOOST_AUTO_TEST_CASE(function_types_sig)
|
||||
char const* text = R"(
|
||||
contract C {
|
||||
function f() returns (bytes4) {
|
||||
return f.sig;
|
||||
return f.selector;
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Member \"sig\" not found");
|
||||
CHECK_ERROR(text, TypeError, "Member \"selector\" not found");
|
||||
text = R"(
|
||||
contract C {
|
||||
function g() internal {
|
||||
}
|
||||
function f() returns (bytes4) {
|
||||
return g.sig;
|
||||
return g.selector;
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Member \"sig\" not found");
|
||||
CHECK_ERROR(text, TypeError, "Member \"selector\" not found");
|
||||
text = R"(
|
||||
contract C {
|
||||
function f() returns (bytes4) {
|
||||
function () g;
|
||||
return g.sig;
|
||||
return g.selector;
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Member \"sig\" not found");
|
||||
CHECK_ERROR(text, TypeError, "Member \"selector\" not found");
|
||||
text = R"(
|
||||
contract C {
|
||||
function f() returns (bytes4) {
|
||||
return this.f.sig;
|
||||
return this.f.selector;
|
||||
}
|
||||
}
|
||||
)";
|
||||
@@ -6325,7 +6325,7 @@ BOOST_AUTO_TEST_CASE(function_types_sig)
|
||||
text = R"(
|
||||
contract C {
|
||||
function f() external returns (bytes4) {
|
||||
return this.f.sig;
|
||||
return this.f.selector;
|
||||
}
|
||||
}
|
||||
)";
|
||||
@@ -6336,7 +6336,7 @@ BOOST_AUTO_TEST_CASE(function_types_sig)
|
||||
}
|
||||
function f() external returns (bytes4) {
|
||||
var g = this.h;
|
||||
return g.sig;
|
||||
return g.selector;
|
||||
}
|
||||
}
|
||||
)";
|
||||
@@ -6347,7 +6347,7 @@ BOOST_AUTO_TEST_CASE(function_types_sig)
|
||||
}
|
||||
function f() external returns (bytes4) {
|
||||
function () external g = this.h;
|
||||
return g.sig;
|
||||
return g.selector;
|
||||
}
|
||||
}
|
||||
)";
|
||||
@@ -6359,7 +6359,7 @@ BOOST_AUTO_TEST_CASE(function_types_sig)
|
||||
function f() external returns (bytes4) {
|
||||
function () external g = this.h;
|
||||
var i = g;
|
||||
return i.sig;
|
||||
return i.selector;
|
||||
}
|
||||
}
|
||||
)";
|
||||
|
||||
Reference in New Issue
Block a user