-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onclosed-obsoleteClosed as the reported issue is no longer relevantClosed as the reported issue is no longer relevantlegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.
Description
For example:
class Monster {
// Returns current health after applying [hp] damage to this monster.
int damage(int hp);
// Returns current health after applying [f()] damage to this monster.
int damageFromClosure(int f());
}
class MockMonster extends Mock implements Monster {}
var mock = new MockMonster();
when(mock.damage(argThat(isPositive))).thenReturn(100);
when(mock.damageFromClosure(argThat(isFunction))).thenReturn(200);
We'll want to allow mock.damage
to avoid the cast to int
. This is safe because when using nSM to implement abstract methods, the method is conceptually implemented by a method that forwards to nSM, and that method can widen the argument types to Object.
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onclosed-obsoleteClosed as the reported issue is no longer relevantClosed as the reported issue is no longer relevantlegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.