Skip to content

Adding a 'pure' function type annotation? #4468

@wizzardx

Description

@wizzardx

This is a feature request.

If a function is annotated as 'pure', then it's checked that it doesn't operate against global state. ie, always returns inputs based only on arguments passed to it, and it doesn't do IO.

Also, functions annotated as 'pure' can only call other functions annotated as 'pure'

More or less, how the D lang describes them:

https://dlang.org/spec/function.html#pure-functions

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions