Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Jun 5, 2024

Remove the avoid_dynamic_calls exception in web_ui, and clean up all dynamic calls.

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Jun 5, 2024
@yjbanov yjbanov changed the title [web] clean up dynamic calls [web] clean up dynamic calls, remove always_specify_types Jun 5, 2024
@yjbanov yjbanov force-pushed the clean-up-dynamic-calls branch from efe1215 to 400d786 Compare June 5, 2024 18:15
@yjbanov yjbanov marked this pull request as ready for review June 5, 2024 18:15
Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup!

assert(
decoded.arguments is int,
'Argument to Skia.setResourceCacheMaxBytes must be an int, but was ${decoded.arguments.runtimeType}',
'Argument to Skia.setResourceCacheMaxBytes must be an int, but was ${(decoded.arguments as Object?).runtimeType}',
Copy link
Member

Choose a reason for hiding this comment

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

I wonder why casting decoded.arguments as Object? doesn't make you access runtimeType trough ?.... I guess null also has runtimeType so it doesn't matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, null has all the Object methods, like runtimeType, toString, operator==, hashCode, etc. It's also surprising why dynamic.runtimeType is considered to be a dynamic invocation. Everything has a runtimeType in Dart. But I guess maybe dynamic.anything is considered "bad" by the lint.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bug in the lint

Copy link
Contributor

Choose a reason for hiding this comment

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

@yjbanov yjbanov added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 6, 2024
@auto-submit auto-submit bot merged commit 32c3b9b into flutter:main Jun 6, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants