Skip to content

Commit 948973e

Browse files
committed
clarify docs for unsupportedMembers.
some problems with the previous wording: - "each such member" is ambiguous since the previous paragraph talks about 2 or perhaps 3 kinds of members: - 1 where the return type is non-nullable and unknown - 1 where it's that plus it's specified in unsupportedMembers - presumably 1 more where it's that plus not in unsupportedMembers - typo: "with throws" - the hypothesis "if unsupportedMembers contains the name of each such member" makes one wonder what unsupportedMembers does in general. is this asserting that client code must put such members into unsupportedMembers? is unsupportedMembers allowed to contain more than that? - "generated with an override" should probably apply to the member, not the class PiperOrigin-RevId: 439901387
1 parent b86c24d commit 948973e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/annotations.dart

+6-5
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,12 @@ class MockSpec<T> {
8888
/// override member, unless the member is specified in [unsupportedMembers],
8989
/// or a fallback implementation is given in [fallbackGenerators].
9090
///
91-
/// If [unsupportedMembers] contains the name of each such member, the mock
92-
/// class is generated with an override, with throws an exception, for each
93-
/// member with a non-nullable unknown return type. Such an override cannot be
94-
/// used with the mockito stubbing and verification APIs, but makes the mock
95-
/// class a valid implementation of the class-to-mock.
91+
/// For each member M in [unsupportedMembers], the mock class will have an
92+
/// override that throws, which may be useful if the return type T of M is
93+
/// non-nullable and it's inconvenient to define a fallback generator for M,
94+
/// e.g. if T is an unknown type variable. Such an override cannot be used
95+
/// with the mockito stubbing and verification APIs, but makes the mock class
96+
/// a valid implementation of the class-to-mock.
9697
///
9798
/// Each entry in [fallbackGenerators] specifies a mapping from a method name
9899
/// to a function, with the same signature as the method. This function is

0 commit comments

Comments
 (0)