dart-lang / mockito

Mockito-inspired mock library for Dart
https://pub.dev/packages/mockito
Apache License 2.0
623 stars 160 forks source link

Support for extension-type/inline-class #732

Closed denniskaselow closed 4 months ago

denniskaselow commented 5 months ago

It's probably too early and/or too minor, but would it be possible to already support extension types (like with -nullsafety)? The experiment has been enabled by default in the Dart dev version for a while now.

For example, if I have a getter returning an extension type, this is what I get:

Bad state: Interface type 'Age' which is nether an enum, nor a class, nor a mixin. This case is unknown, please report a bug.
package:mockito/src/builder.dart 1655:7                    _MockClassInfo._dummyValueImplementing
package:mockito/src/builder.dart 1549:12                   _MockClassInfo._dummyValue
package:mockito/src/builder.dart 1946:24                   _MockClassInfo._buildOverridingGetter

And I'm just seeing this, but there is a typo in the error message. It should be "neither" not "nether".

yanok commented 4 months ago

EDIT: uh, actually the feature is already there. Yep, I will have to find time to add the support then.

yanok commented 4 months ago

The version at HEAD should now cover the "method returns an extension type" case. We'll do a release soon.