Lasse Damgaard
2015-09-17 07:35:38 UTC
The new null aware operators are awesome. One thing I'm really missing
however is null aware map lookup.
In other words I want this to be true instead of a compile error:
Map nullMap;
expect(nullMap?['foobar'], isNull);
Are there any plans to add this?
Alternatively, instead of supporting null aware access for overloaded
operators Map should just define add and get methods.
I've also been missing that in other situations such as this completely
nonsense example:
final someMap = {'foo':1, 'bar':2, 'baz':3};
final values = [1,2].map(someMap.get);
Lasse
however is null aware map lookup.
In other words I want this to be true instead of a compile error:
Map nullMap;
expect(nullMap?['foobar'], isNull);
Are there any plans to add this?
Alternatively, instead of supporting null aware access for overloaded
operators Map should just define add and get methods.
I've also been missing that in other situations such as this completely
nonsense example:
final someMap = {'foo':1, 'bar':2, 'baz':3};
final values = [1,2].map(someMap.get);
Lasse
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.