args
args copied to clipboard
addMultiOption mutable default leaks state
var parser = ArgParser()..addMultiOption('foo');
parser.parse([])['foo']).add('leaked state');
expect(parser.parse([])['foo'], isEmpty);
Expected: empty
Actual: ['leaked state']
We could either make the default const or make it always a new copy.
My only concern is the potentially breaking nature of fixing this.... anything we do would technically be breaking although the copy approach would be very unlikely to break anybody I think.