We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
extension
Reproducable code
import 'package:mobx/mobx.dart'; part 'view_model.g.dart'; class ViewModel = _ViewModel with _$ViewModel; abstract class _ViewModel with Store { @observable List<int> list = []; } extension on int {}
Error
[INFO] Starting Build [INFO] Updating asset graph completed, took 1ms [SEVERE] mobx_codegen:mobx_generator on lib/view_model.dart: Null check operator used on a null value package:mobx_codegen/src/type_names.dart 32:46 LibraryScopedNameFinder.namesByElement package:mobx_codegen/src/type_names.dart 137:12 LibraryScopedNameFinder._getNamedElementTypeName package:mobx_codegen/src/type_names.dart 94:12 LibraryScopedNameFinder._getDartTypeName dart:_internal ListIterable.toList package:mobx_codegen/src/type_names.dart 133:56 LibraryScopedNameFinder._getNamedElementTypeName package:mobx_codegen/src/type_names.dart 94:12 LibraryScopedNameFinder._getDartTypeName package:mobx_codegen/src/type_names.dart 48:7 LibraryScopedNameFinder.findVariableTypeName package:mobx_codegen/src/store_class_visitor.dart 100:28 StoreClassVisitor.visitFieldElement package:analyzer/src/dart/element/element.dart 3110:54 FieldElementImpl.accept package:analyzer/src/dart/element/element.dart 2491:13 ElementImpl.visitChildren package:mobx_codegen/src/mobx_codegen_base.dart 85:9 StoreGenerator._generateCodeFromTemplate package:mobx_codegen/src/mobx_codegen_base.dart 67:13 StoreGenerator._generateCodeForMixinStore dart:core Iterable.toSet package:mobx_codegen/src/mobx_codegen_base.dart 26:68 StoreGenerator.generate package:source_gen/src/builder.dart 342:33 _generate dart:async Stream.toList.<fn> package:source_gen/src/builder.dart 107:9 _Builder._generateForLibrary package:source_gen/src/builder.dart 99:5 _Builder.build [INFO] Running build completed, took 47ms [INFO] Caching finalized dependency graph completed, took 23ms [SEVERE] Failed after 74ms
Packages
build_runner: ^2.4.11 mobx_codegen: ^2.6.1 flutter_mobx: ^2.2.1+1 mobx: ^2.3.3+2
Flutter version: 3.22.2 if I add name to extension, it will work fine
3.22.2
extension _intX on int {}
The text was updated successfully, but these errors were encountered:
Omg. This is such a life saver. I tried all my luck but couldn't get through the build runner. Thanks
Sorry, something went wrong.
This is also a problem with extension type since it does expect on and a name.
extension type
on
Merge branch 'main' into mobxjsgh-1010
a3a2b00
amondnet
Successfully merging a pull request may close this issue.
Reproducable code
Error
Packages
Flutter version:
3.22.2
if I add name to extension, it will work fine
The text was updated successfully, but these errors were encountered: