argotorg / argotorg/solidity

Function type conversion mistake?

Open
#13,942 4 comments 0 reactions 0 assignees View on GitHub
annoys users :cry: documentation :book: low effort must have eventually
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

## Page

https://docs.soliditylang.org/en/v0.8.18/types.html#function-types

## Abstract

Under the sub-section "**Conversions**", it's mentioned that a function type of **A** is convertible to **B**, if **A** is _more restrictive_ than **B**.
In the examples, it says `payable` is convertible to `non-payable`. So taking `A = payable`, and `B = non-payable`, it looks contradictory in the next paragraph, which says that `non-payable` functions (B) are more restrictive than `payable` ones (A). Is this a mistake, or I'm just not getting it right?

## Pull request

No pull request made, since I'm not sure if my argument is right.

Contributor guide

Open the contributing guide

Research direction

Read the Function Types page at the linked URL, focusing on the “Conversions” subsection and its examples for payable and non-payable functions. Verify whether the statements about convertibility and restrictiveness are consistent, then clarify the wording so the rule and example agree; done means the documentation no longer presents a contradiction.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.