Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Issue 311893002: Tweaks for typed_mock. (Closed)

Created:
6 years, 6 months ago by scheglov
Modified:
6 years, 6 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Tweaks for typed_mock. 1. Force dynamic type for 'any*' matchers, now we propagate types of top-level variables and fields, so using these matchers causes hints. 2. Remove equals() matcher, in conflicts with the one from unittest. R=brianwilkerson@google.com, paulberry@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=36954

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -20 lines) Patch
M pkg/typed_mock/lib/typed_mock.dart View 6 chunks +5 lines, -10 lines 1 comment Download
M pkg/typed_mock/pubspec.yaml View 1 chunk +1 line, -1 line 0 comments Download
M pkg/typed_mock/test/typed_mock_test.dart View 2 chunks +1 line, -9 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
scheglov
6 years, 6 months ago (2014-06-03 16:11:17 UTC) #1
Brian Wilkerson
LGTM, but > 1. Force dynamic type for 'any*' matchers, now we propagate types of ...
6 years, 6 months ago (2014-06-03 22:10:46 UTC) #2
scheglov
On 2014/06/03 22:10:46, Brian Wilkerson wrote: > LGTM, but > > > 1. Force dynamic ...
6 years, 6 months ago (2014-06-03 22:19:52 UTC) #3
scheglov
Committed patchset #1 manually as r36954 (presubmit successful).
6 years, 6 months ago (2014-06-03 22:21:25 UTC) #4
kevmoo
DBQ https://codereview.chromium.org/311893002/diff/1/pkg/typed_mock/lib/typed_mock.dart File pkg/typed_mock/lib/typed_mock.dart (right): https://codereview.chromium.org/311893002/diff/1/pkg/typed_mock/lib/typed_mock.dart#newcode392 pkg/typed_mock/lib/typed_mock.dart:392: final anyBool = new _ArgumentMatcher_anyBool() as dynamic; Doesn't ...
6 years, 6 months ago (2014-06-03 23:50:10 UTC) #5
scheglov
On 2014/06/03 23:50:10, kevmoo wrote: > DBQ > > https://codereview.chromium.org/311893002/diff/1/pkg/typed_mock/lib/typed_mock.dart > File pkg/typed_mock/lib/typed_mock.dart (right): > ...
6 years, 6 months ago (2014-06-04 00:36:50 UTC) #6
kevmoo
On 2014/06/04 00:36:50, scheglov wrote: > On 2014/06/03 23:50:10, kevmoo wrote: > > DBQ > ...
6 years, 6 months ago (2014-06-04 05:00:09 UTC) #7
scheglov
6 years, 6 months ago (2014-06-04 14:38:58 UTC) #8
Message was sent while issue was closed.
On 2014/06/04 05:00:09, kevmoo wrote:
> On 2014/06/04 00:36:50, scheglov wrote:
> > On 2014/06/03 23:50:10, kevmoo wrote:
> > > DBQ
> > > 
> > >
> >
>
https://codereview.chromium.org/311893002/diff/1/pkg/typed_mock/lib/typed_moc...
> > > File pkg/typed_mock/lib/typed_mock.dart (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/311893002/diff/1/pkg/typed_mock/lib/typed_moc...
> > > pkg/typed_mock/lib/typed_mock.dart:392: final anyBool = new
> > > _ArgumentMatcher_anyBool() as dynamic;
> > > Doesn't typing the final as 'dynamic' accomplish the same thing...perhaps
a
> > bit
> > > prettier.
> > > 
> > > Also: could these all be const?
> > 
> > Unfortunately no.
> > Currently we don't distinguish "var" (or "final" without any type
annotation)
> > and explicit "dynamic" type annotation when do type propagation.
> > So, we have to force dynamic type using type cast.
> > 
> > And, because a type cast expression is not a constant, we cannot declare
these
> > "any*" top-level variables as constants.
> 
> That's unfortunate, but understandable.
> 
> You could have const classes and instantiation, right?
> 
> final anyBool = const _ArgumentMatcher_anyBool() as dynamic;

Yes, that's possible.
https://codereview.chromium.org/318683003

Powered by Google App Engine
This is Rietveld 408576698