Skip to content

Conversation

@kevmoo
Copy link
Collaborator

@kevmoo kevmoo commented Sep 25, 2017

No description provided.

@kevmoo kevmoo requested a review from jakemac53 September 25, 2017 17:16
}

if (value is Map) return _jsonMapAsDart(value, asConst);
if (value is Map<String, dynamic>) return _jsonMapAsDart(value, asConst);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these types of checks any more sane than they used to be (won't this return true for Map<dynamic, dynamic>)?

I guess you are just trying to avoid the explicit cast given the tighter type on _jsonMapAsDart, but this sends a bit of the wrong signal imo... I would rather see the cast when you pass the value in to _jsonMapAsDart as its a bit more obvious that you are explicitly casting it and it could technically fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants