Giter Club home page Giter Club logo

Comments (4)

dart-github-bot avatar dart-github-bot commented on July 18, 2024

Summary: The IntelliJ Dart analyzer is not providing error resolution suggestions for the entire file, despite the presence of errors. This issue prevents users from efficiently fixing errors in their code.

from sdk.

rxvivek avatar rxvivek commented on July 18, 2024

If i wanted to add null safety in whole file then i have to add manually as dart does not support migration in other versions. Dart analyzer should provide this feature to solve errors effectively.

Doing manually error solving for same time of errros is very hard for large projects.

from sdk.

bwilkerson avatar bwilkerson commented on July 18, 2024

If i wanted to add null safety in whole file then i have to add manually as dart does not support migration in other versions.

In versions of the SDK before 3.0 (when non-nullable by default became the only option) there was a migration tool specifically targeted at this kind of migration. If you can go back to an earlier version to do the migration, that might be the easiest path forward. (We can't support the migration tool in 3.0 because the tools no longer understand pre 2.12 code.)

Doing manually error solving for same time of errros is very hard for large projects.

Yes it is.

The reasons we don't currently support this operation across multiple locations within the same file are:

  1. Adding a null check changes the type of the expression in ways that can cause other null-related diagnostics to appear or disappear. There's no guarantee that adding a null check operator in some given location would still be necessary or appropriate after adding a null check operator somewhere else.

  2. Add a null check operator is rarely the right way to solve the problem, so you really ought to be looking at each site individually to decide whether there might be a better way to solve the problem. One reason why it's not usually the right solution is because it converts a compile-time error into a run-time error, and run-time errors tend to be harder to find and fix.

I'm not sure we'd want to enable this fix for broad use across a file because of those reasons.

from sdk.

rxvivek avatar rxvivek commented on July 18, 2024

Thanks for the valuable feedback.
What I did to migrate null safety

  1. Followed the steps to migrate to null safety. [2.10.5 to 3.7.12 flutter version]
  2. Migrated to drift database from moor.
  3. Still migration errors as well as some null safety errors in the project [dart analyzer didn't solve null safety in project, they solved some part of files.].
  4. Downgraded again but now i am facing an error of drift errors as well as null safety compilation errors, Due to that i can't migrate to null safety against those files are pending to migrate to null safety.
  5. So i used dart migrate --skip-import-check --ignore-errors to ignore errors but migration can't apply for those file.

from sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.