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

migrate to Dart null safety mode #419

Open
dave-doty opened this issue Aug 2, 2020 · 3 comments · Fixed by #989
Open

migrate to Dart null safety mode #419

dave-doty opened this issue Aug 2, 2020 · 3 comments · Fixed by #989
Labels
closed in dev Indicates issue is closed in the dev branch, available at: https://scadnano.org/dev/ extremely challenging invalid This doesn't seem right

Comments

@dave-doty
Copy link
Member

dave-doty commented Aug 2, 2020

Dart null safety is coming soon. It will have stronger checks on types than older versions, in particular:

https://codewithandrea.com/articles/2020-06-22-implicit-downcast-no-longer-allowed/#disabling-implicit-downcasts-in-analysis_optionsyaml

We can enable those checks to be reported by the static analyzer in Dart 2.8, in analysis_options.yaml, by setting these two values to false:

analyzer:
  strong-mode:
    implicit-casts: false
    implicit-dynamic: false

Do this and then deal with the avalanche of type errors.

One annoying thing is that is requires every function/method to have a return type, even though I've been leaving it off for functions with a void return type. So there will be several hundred of these to correct.

@dave-doty dave-doty added invalid This doesn't seem right high priority Something cruicial to get working soon. labels Aug 2, 2020
@dave-doty dave-doty added the challenging indicates that fixing this issue is expected to be more challenging than average label Nov 25, 2020
@dave-doty dave-doty changed the title make all tests pass in Dart 2.9 strong mode make all tests pass in Dart null safety strong mode Jan 17, 2021
@dave-doty dave-doty removed the high priority Something cruicial to get working soon. label Jan 17, 2021
@dave-doty dave-doty added extremely challenging and removed challenging indicates that fixing this issue is expected to be more challenging than average labels Nov 17, 2023
@dave-doty
Copy link
Member Author

We have been unable to implement this while OverReact did not support null safety. Now it does as of version 5.0.0: https://pub.dev/packages/over_react/changelog

@dave-doty dave-doty changed the title make all tests pass in Dart null safety strong mode migrate to Dart null safety mode Apr 4, 2024
@dave-doty
Copy link
Member Author

There is a migration tool to help: https://dart.dev/null-safety/migration-guide#step3-analyze

@dave-doty
Copy link
Member Author

@dave-doty dave-doty linked a pull request Sep 13, 2024 that will close this issue
@dave-doty dave-doty added the closed in dev Indicates issue is closed in the dev branch, available at: https://scadnano.org/dev/ label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed in dev Indicates issue is closed in the dev branch, available at: https://scadnano.org/dev/ extremely challenging invalid This doesn't seem right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant