Merge pull request #11956 from ethereum/userDefinedTypesContractAccess

Allow accessing user defined value type members via contract name.
This commit is contained in:
Daniel Kirchner
2021-09-14 17:14:04 +02:00
committed by GitHub
4 changed files with 42 additions and 0 deletions
@@ -0,0 +1,9 @@
contract C { type T is uint; }
library L { type T is uint; }
interface I { type T is uint; }
contract D
{
C.T x = C.T.wrap(uint(1));
L.T y = L.T.wrap(uint(1));
I.T z = I.T.wrap(uint(1));
}
@@ -0,0 +1,8 @@
contract C { type T is uint; }
library L { type T is uint; }
contract D
{
C.T x = L.T.wrap(uint(1));
}
// ----
// TypeError 7407: (86-103): Type user defined type T is not implicitly convertible to expected type user defined type T.