mobx.dart icon indicating copy to clipboard operation
mobx.dart copied to clipboard

Failing to generate store with generics

Open Andreigr0 opened this issue 6 months ago • 2 comments

Generator fails to generate a store when this store uses generics and not imported the type of the generic. I've created a sample project: https://github.com/Andreigr0/mobx_generator_generics_bug.git

Go to some_store_with_generic_value.dart and try comment the line import 'package:mobx_generator_generics_bug/main.dart'; this will break generator and it's not obvious since original line would be 16: GeneratedModelWithGeneric? get someValue => null; though generator expects line 17: GeneratedModelWithGeneric<Subtype>? get someValue => null;

Andreigr0 avatar Jun 16 '25 14:06 Andreigr0

@Andreigr0 We can make the build work without the import, but the generated code still requires the import .

amondnet avatar Sep 16 '25 11:09 amondnet

@amondnet as long as it is obvious where the error came from, it will be okay

Andreigr0 avatar Sep 16 '25 11:09 Andreigr0