Skip to content

Functions implicit conversions #620

@onbjerg

Description

@onbjerg

Describe the feature

A function type A is implicitly convertible to a function type B iff their parameter types are identical, their return types are identical, their external/internal property is identical, and the state mutability of A is more restrictive than the state mutability of B.

  • pure functions can be converted to view and non-payable functions
  • view can be converted to non-payable
  • payable can be converted to non-payable

No other function type conversions are possible.

See Solidity's docs.

Additional context

No response

Metadata

Metadata

Assignees

Labels

A-semaArea: semantic analysisC-enhancementCategory: an issue proposing an enhancement or a PR with one

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions