You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A very very strange bug. A whole bunch of things must happen to trigger this bug
mockito: 5.4.4
// A typedef of any function FunctiontypedefCreateInt=intFunction();
// A base class which uses a genericclassBaseFoo<T> {
BaseFoo(this.t);
// The class uses the generic and it's not nullablefinalT t;
}
// Class which extends the base class and uses super()classFooextendsBaseFoo<CreateInt> {
Foo() :super(() =>1);
}
Console:
Resolving dependencies in `C:\Users\dicke\DickerSystems\repromockito`... Downloading packages...Got dependencies in `C:\Users\dicke\DickerSystems\repromockito`.Building package executable... (2.3s)Built build_runner:build_runner.[INFO] Generating build script completed, took 183ms[INFO] Precompiling build script... completed, took 2.3s[INFO] Building new asset graph completed, took 462ms[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms[INFO] Generating SDK summary completed, took 2.8s[SEVERE] mockito:mockBuilder on test/repromockito_test.dart:Bad state: Asset URI is missing for typedef CreateInt = dynamic Function()package:mockito/src/builder.dart 2195:10 _MockClassInfo._typeImportpackage:mockito/src/builder.dart 2154:19 _MockClassInfo._typeReference.<fn>package:code_builder/src/specs/type_reference.g.dart 164:33 _$TypeReferenceBuilder.updatepackage:code_builder/src/specs/type_reference.g.dart 22:36 new _$TypeReferencepackage:mockito/src/builder.dart 2151:14 _MockClassInfo._typeReferencepackage:mockito/src/builder.dart 1910:25 _MockClassInfo._buildOverridingGetterpackage:mockito/src/builder.dart 1224:36 _MockClassInfo.fieldOverrides.<fn>package:code_builder/src/specs/method.g.dart 323:33 _$MethodBuilder.updatepackage:code_builder/src/specs/method.g.dart 38:29 new _$Methodpackage:mockito/src/builder.dart 1224:15 _MockClassInfo.fieldOverridesdart:core List.addAllpackage:built_collection/src/list/list_builder.dart 98:14 ListBuilder.addAllpackage:mockito/src/builder.dart 1182:28 _MockClassInfo._buildMockClass.<fn>.<fn>package:mockito/src/builder.dart 2070:24 _MockClassInfo._withTypeParameterspackage:mockito/src/builder.dart 1135:7 _MockClassInfo._buildMockClass.<fn>package:code_builder/src/specs/class.g.dart 345:33 _$ClassBuilder.updatepackage:code_builder/src/specs/class.g.dart 40:28 new _$Classpackage:mockito/src/builder.dart 1113:12 _MockClassInfo._buildMockClasspackage:mockito/src/builder.dart 1059:9 new _MockLibraryInfopackage:mockito/src/builder.dart 94:29 MockBuilder.build[INFO] Running build completed, took 3.1s[INFO] Caching finalized dependency graph completed, took 26ms[SEVERE] Failed after 3.1s
I've traced this down to the fact that calling supertype.typeArguments returns an unwrapped version of the typedef (BaseFoo<int Function()>), instead of the typedef itself BaseFoo<CreateInt>.
So during analysis CreateInt is not added to the types.
A very very strange bug. A whole bunch of things must happen to trigger this bug
mockito: 5.4.4
Console:
repro: https://github.com/dickermoshe/repromockito
General info
Project info
Process info
The text was updated successfully, but these errors were encountered: