Open
Description
e.g. Adding a test to constants_test.dart:
@TypeWrapper(String)
class Example {}
class TypeWrapper {
final Type t;
const TypeWrapper(this.t);
}
test('should not crash when resolving types', () {
expect(typeWrapperConstant.read('t').revive(), isNull /* or anything */)
});
throws the following:
Bad state: No element
dart:core List.first
package:source_gen/src/constants/revive.dart 97:21 reviveInstance
package:source_gen/src/constants/reader.dart 276:25 _DartObjectConstant.revive
test/constants_test.dart 356:49 main.<fn>.<fn>
I don't know what the correct behaviour is, but I know the code should not crash.