Solidity.

Post

Share your knowledge.

0x8744...6532.
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

1
0x8744...6532.
Jan 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
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.