Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix map cast #35

Merged
merged 3 commits into from
Apr 6, 2021
Merged

Fix map cast #35

merged 3 commits into from
Apr 6, 2021

Conversation

festelo
Copy link
Contributor

@festelo festelo commented Mar 7, 2021

Получал вот такую ошибку - Uncaught TypeError: Instance of '_JsonMap': type '_JsonMap' is not a subtype of type 'Map<String, Object>'.
Т.е. нельзя закастовать dynamic (_JsonMap) к Map<String, Object>, потому что _JsonMap не наследуется от Map<String, Object>. Если в сурцы заглянуть, они вот здесь - https://github.com/dart-lang/sdk/blob/master/sdk/lib/_internal/js_runtime/lib/convert_patch.dart, то можно увидеть, что наследуется оно от Map<String, dynamic>. dynamic != Object. (возможно проблема была только при использовании с nnbd с соседнего PR, без него не тестил)

@otopba otopba requested review from otopba and sanekyy March 9, 2021 12:44
Copy link

@otopba otopba left a comment

Choose a reason for hiding this comment

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

Спасибо! Только нужно повысить версию и написать сhangelog

@festelo
Copy link
Contributor Author

festelo commented Mar 9, 2021

Пойдет?

@otopba
Copy link

otopba commented Mar 9, 2021

Пойдет?

Да, супер

@otopba otopba self-requested a review March 9, 2021 13:26
@otopba otopba merged commit dd72ef4 into optimist-dev:main Apr 6, 2021
@otopba
Copy link

otopba commented Apr 6, 2021

Сори за долгий ответ. Вмержено!

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.

None yet

3 participants