Skip to content

Lowering the requirements for default const parameters #429

Open
@wrozwad

Description

@wrozwad

Documentation says that

The default values must be compile-time constants

I'm curious why const values are required. I think it would be better if this requirement will be lowering a bit. It'll be awesome to be able to use previous passed arguments as default parameters or every time create a new modifiable default list in place of using const one:

void read(byte[] bytes, {int offset = 0, int length = bytes.size, byte[] avoid = []}) { 
  ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions