Skip to content

CommandLine.arguments and CommandLine.argc should be deprecated and replaced with immutable equivalents. #66213

Closed
@Lukasa

Description

@Lukasa

CommandLine.arguments and CommandLine.argc are both declared static var. This is a real footgun: they're unsafe to use in a concurrency context because they may be mutated from any thread at any time. There's no real value in these being mutable so I think it is largely an oversight. We should consider deprecating these and replacing them with thread-safe equivalents.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.input & outputArea → standard library: Input & outputstandard libraryArea: Standard library umbrellaswift 5.9

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions