Comments (4)
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.
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.
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:
-
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.
-
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.
Thanks for the valuable feedback.
What I did to migrate null safety
- Followed the steps to migrate to null safety. [2.10.5 to 3.7.12 flutter version]
- Migrated to drift database from moor.
- 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.].
- 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.
- 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)
- Dart lacks a way to create an error chain HOT 4
- [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: SocketException: Send failed (OS Error: No route to host, errno = 65), address = 0.0.0.0, port = 1900 HOT 1
- Inconsistent string interpolation in dart runtime with RTL languages HOT 1
- bug: Dart does not narrow the type properly across more than one level of inheritance in a collection type HOT 4
- `dart test --coverage`: getSourceReport: (-32000) Service connection disposed HOT 4
- Import name conflicts: Suggest adding "hide" on one of the conflicting imports HOT 1
- bug: dart analyzer does not catch the error `FutureOr<Object>? Function()' can't be assigned to the parameter type 'FutureOr<Object> Function()` HOT 2
- Nullable `VoidCallback` call function can't see nullable return HOT 2
- Running analyzer benchmark always crashes with a SocketException HOT 1
- Should a comment reference on a type alias be able to refer to members of the aliased type? HOT 4
- Performance regression in 'das-flutter-start' Analyzer benchmark, due to doc-imports HOT 1
- Failures on [DEPS] Roll chrome to the latest beta version (127)
- dedup_instructions only dedups leaf functions HOT 5
- Poor error message for ambiguous_extension_member_access when two extensions exist with the same name. HOT 1
- Seemingly incorrect "FormatException" when using `stream.transform(json.decoder)` HOT 3
- Allow users and/or packages to create custom versions of "Wrap with ..." actions HOT 1
- [Null-aware elements] Analyzer Implementation
- [Null-aware elements] Implement AST enhancements
- standalone/io/unix_socket_test went from flaky -> RuntimeError on vm-reload-linux-debug-x64 HOT 1
- [CP] DevTools 2.37.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.