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

Issue 2712603006: Use a `confuse` function. (Closed)

Created:
3 years, 10 months ago by floitsch
Modified:
3 years, 9 months ago
Reviewers:
sra1
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -5 lines) Patch
M tests/language/mixin_proto_test.dart View 1 chunk +9 lines, -5 lines 2 comments Download

Messages

Total messages: 6 (2 generated)
floitsch
TBR.
3 years, 10 months ago (2017-02-24 12:35:04 UTC) #2
floitsch
Committed patchset #1 (id:1) manually as d0dc7be4a15c2cca1c24e67c8a4cac5e1653e59e (presubmit successful).
3 years, 10 months ago (2017-02-24 12:35:27 UTC) #4
sra1
lgtm https://codereview.chromium.org/2712603006/diff/1/tests/language/mixin_proto_test.dart File tests/language/mixin_proto_test.dart (right): https://codereview.chromium.org/2712603006/diff/1/tests/language/mixin_proto_test.dart#newcode35 tests/language/mixin_proto_test.dart:35: Expect.equals(44, confuse(all[0]).foo()); FYI You could also write confuse(new ...
3 years, 10 months ago (2017-02-24 17:30:08 UTC) #5
floitsch
3 years, 9 months ago (2017-02-27 14:42:24 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/2712603006/diff/1/tests/language/mixin_proto_...
File tests/language/mixin_proto_test.dart (right):

https://codereview.chromium.org/2712603006/diff/1/tests/language/mixin_proto_...
tests/language/mixin_proto_test.dart:35: Expect.equals(44,
confuse(all[0]).foo());
On 2017/02/24 17:30:08, sra1 wrote:
> FYI
> 
> You could also write  confuse(new A())
> 
> If you want an inferred type that is not dynamic, but s specific union, you
can
> use something like
> 
> confuseABC(x) (
>   var a = confuse(x);
>   if (a is A) return a;
>   if (a is B) return a;
>   if (a is C) return a;
>   throw 123;
> }
> 
> confuseABC(new A())  - dynamic A with static type {A,B,C}.

Acknowledged. I don't think that's necessary here.
I guess that confusing the index would also be ok.
`all[confuse(0)]`

Powered by Google App Engine
This is Rietveld 408576698