From documentation, in this specific case for integers you can use only this two method:
min()
: represent the smallest value about data type you passed;
max()
: represent the largest value about data type you passed.
In your smart contract, you need to change this line type(uint16)
adding one of these functions: min
or max
and at this point you can return the same datatype (in this case uint16).
This because max and min function refers only to integer that you would to know the minimum and maximum values.
Example:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
contract TypeTest {
function checkMinValue() external view returns(uint16){
return type(uint16).min;
}
function checkMaxValue() public view returns(uint16){
return type(uint16).max;
}
}