None of the patterns in the switch expression the matched after hot-reload #55350
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
vm-hot-reload
Issue originally discussed on X (Twitter) with @mraleph.
Example project with a reproducible issue is originally stripped down version of our large project. I tried to minimize code to absolute minimum with some files which I believe are interesting and related to this issues.
What is happening?
Project is monorepo based application. Application is in
apps
folder and there is alsocore
packages containing some "core" domain types.We have enhanced enum
ModuleType
in "core" package. This enum describes available module of app (doesn't really matter for issue]. Inapp
there ismodule_type_extension
- a extension onModuleType
with simple switch expression returning some value based on ModuleType's value (for example path to icon).After hot-reload sometimes issue appears:
but I don't understand why.
Some noticeable things
apps/patterns_repro/lib/shared/widgets/dialogs/action/action_dialog.dart
- this file is not used by home_page and related widgets BUT still somehow affects.What I suspect: Issues seems to be related somehow to "barell" files and cyclic imports and exports. But my knowledge is falling behind to understand it.
How to repro step by step
height
on line 9 inapps/patterns_repro/lib/modules/home/widgets/enabled_modules_view.dart
. (Or just anything there to invoke hot reload)However like I said before
Dart and Flutter versions
NOTE: Tested on different machines with Windows and MacOS.
Link to project: https://github.com/petrnymsa/dart-pattern-none-issue
The text was updated successfully, but these errors were encountered: