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

Add types to more parameters #162

Merged
merged 2 commits into from
Dec 28, 2020
Merged

Add types to more parameters #162

merged 2 commits into from
Dec 28, 2020

Conversation

natebosch
Copy link
Member

Find parameters that are implicitly dynamic and add a static type of
either Object? or in some cases where a non-null value was clearly
required Object. There may be missed cases where a non-null value is
required.

Add as dynamic casts back in places where we were already relying on
dynamic calls as required to pass static analysis. This has the added
benefit of making those dangerous calls more obvious.

Find parameters that are implicitly `dynamic` and add a static type of
either `Object?` or in some cases where a non-null value was clearly
required `Object`. There may be missed cases where a non-null value is
required.

Add `as dynamic` casts back in places where we were already relying on
dynamic calls as required to pass static analysis. This has the added
benefit of making those dangerous calls more obvious.
@kevmoo
Copy link
Member

kevmoo commented Dec 16, 2020

Isn't there a lint for this?

@kevmoo
Copy link
Member

kevmoo commented Dec 16, 2020

Implicit dynamic in analysis options or something?

@natebosch
Copy link
Member Author

Isn't there a lint for this?

Yes there is an analyzer option, not lint. It impacts too much other stuff so I haven't emailed it but that is how I found these.

@natebosch natebosch merged commit 2071cfd into master Dec 28, 2020
@natebosch natebosch deleted the implicit-dynamic branch December 28, 2020 19:15
natebosch added a commit that referenced this pull request Dec 28, 2020
This argument had been implicitly dynamic. #162 made it `Object?` which
can cause analysis errors that are otherwise hidden due to implicit
casts. Any classes which implement `Matcher` and override `match` could
omit the argument type, which mean to inherit from the parent. When that
became `Object?` the cast to some other type which could have been
implicit coming from `dynamic` must now be explicit.
natebosch added a commit that referenced this pull request Dec 29, 2020
This argument had been implicitly dynamic. #162 made it `Object?` which
can cause analysis errors that are otherwise hidden due to implicit
casts. Any classes which implement `Matcher` and override `match` could
omit the argument type, which mean to inherit from the parent. When that
became `Object?` the cast to some other type which could have been
implicit coming from `dynamic` must now be explicit.
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