mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Improved error message for lookup in function types.
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
contract A{
|
||||
function f() public pure{
|
||||
|
||||
}
|
||||
}
|
||||
contract B{
|
||||
A public a;
|
||||
}
|
||||
contract C{
|
||||
B public b;
|
||||
}
|
||||
contract D{
|
||||
C c;
|
||||
function f() public view{
|
||||
c.b.a.f();
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (170-175): Member "a" not found or not visible after argument-dependent lookup in function () view external returns (contract B). Did you intend to call the function?
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
contract A{
|
||||
function f() public pure{
|
||||
|
||||
}
|
||||
}
|
||||
contract B{
|
||||
A public a;
|
||||
}
|
||||
contract C{
|
||||
B b;
|
||||
function f() public view{
|
||||
b.a.f();
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError: (140-145): Member "f" not found or not visible after argument-dependent lookup in function () view external returns (contract A). Did you intend to call the function?
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
contract A{
|
||||
|
||||
}
|
||||
contract B{
|
||||
A public a;
|
||||
}
|
||||
contract C{
|
||||
B b;
|
||||
function f() public view{
|
||||
b.a.f();
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError: (104-109): Member "f" not found or not visible after argument-dependent lookup in function () view external returns (contract A). Did you intend to call the function?
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
contract A{
|
||||
function f() public pure{
|
||||
|
||||
}
|
||||
}
|
||||
contract B{
|
||||
A private a;
|
||||
}
|
||||
contract C{
|
||||
B b;
|
||||
function f() public view{
|
||||
b.a.f();
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError: (141-144): Member "a" not found or not visible after argument-dependent lookup in contract B.
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
contract A{
|
||||
function f() private pure{
|
||||
|
||||
}
|
||||
}
|
||||
contract B{
|
||||
A public a;
|
||||
}
|
||||
contract C{
|
||||
B b;
|
||||
function f() public view{
|
||||
b.a.f();
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError: (141-146): Member "f" not found or not visible after argument-dependent lookup in function () view external returns (contract A). Did you intend to call the function?
|
||||
Reference in New Issue
Block a user