Post
Share your knowledge.
Jan 22, 2023
Expert Q&A
What is the return type of "type" in solidity?
In solidity, you can call the type function to get information about a type.
But what is the return type of the type function?
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
contract TypeTest {
function whatType() public returns(?????){
return type(uint16);
}
}
- Solidity
0
1
Share
Comments
Answers
1Jan 30 2023, 16:29
According to the solidity docs you can't just return type(uint) it has to have type(uint256).max or min or something.
1
Comments
Do you know the answer?
Please log in and share it.
Solidity is an object-oriented, high-level language for implementing smart contracts. It is a curly-bracket language designed to target the Ethereum Virtual Machine (EVM).
43Posts49Answers
Trending posts
- My ERC721 contract successfully deploys, but I can't verify the contract's source code with hardhat21
- Solidity and ethers.js Compute Different Addresses from the Same Signature21
- can't understand what are the locations(uint256)22
- How to reverse keccak256 in solidity22
- Clarification on Gas Refunds and Comparison Between "require" and "revert" in Smart Contracts21