aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/GlobalContext.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2019-01-10 23:28:39 +0800
committerchriseth <chris@ethereum.org>2019-01-18 03:36:48 +0800
commit2fcfb216b5dcb5cec2d70d2ee7647df47c8166ca (patch)
tree7e2db049befab49b3b0a22a9e325ca4f10614337 /libsolidity/analysis/GlobalContext.cpp
parent44237211d1032c739636ab60a558521d60023b88 (diff)
downloaddexon-solidity-2fcfb216b5dcb5cec2d70d2ee7647df47c8166ca.tar.gz
dexon-solidity-2fcfb216b5dcb5cec2d70d2ee7647df47c8166ca.tar.zst
dexon-solidity-2fcfb216b5dcb5cec2d70d2ee7647df47c8166ca.zip
Syntax for meta type information.
Diffstat (limited to 'libsolidity/analysis/GlobalContext.cpp')
-rw-r--r--libsolidity/analysis/GlobalContext.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libsolidity/analysis/GlobalContext.cpp b/libsolidity/analysis/GlobalContext.cpp
index cd5fe07d..2276d783 100644
--- a/libsolidity/analysis/GlobalContext.cpp
+++ b/libsolidity/analysis/GlobalContext.cpp
@@ -61,7 +61,14 @@ m_magicVariables(vector<shared_ptr<MagicVariableDeclaration const>>{
make_shared<MagicVariableDeclaration>("sha256", make_shared<FunctionType>(strings{"bytes memory"}, strings{"bytes32"}, FunctionType::Kind::SHA256, false, StateMutability::Pure)),
make_shared<MagicVariableDeclaration>("sha3", make_shared<FunctionType>(strings{"bytes memory"}, strings{"bytes32"}, FunctionType::Kind::KECCAK256, false, StateMutability::Pure)),
make_shared<MagicVariableDeclaration>("suicide", make_shared<FunctionType>(strings{"address payable"}, strings{}, FunctionType::Kind::Selfdestruct)),
- make_shared<MagicVariableDeclaration>("tx", make_shared<MagicType>(MagicType::Kind::Transaction))
+ make_shared<MagicVariableDeclaration>("tx", make_shared<MagicType>(MagicType::Kind::Transaction)),
+ make_shared<MagicVariableDeclaration>("type", make_shared<FunctionType>(
+ strings{"address"} /* accepts any contract type, handled by the type checker */,
+ strings{} /* returns a MagicType, handled by the type checker */,
+ FunctionType::Kind::MetaType,
+ false,
+ StateMutability::Pure
+ )),
})
{
}