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

Issue 17502003: Doing a call on a getter does not yield the return type of that getter. (Closed)

Created:
7 years, 6 months ago by ngeoffray
Modified:
7 years, 6 months ago
Reviewers:
kasperl
CC:
reviews_dartlang.org, dan_mixbook.com
Visibility:
Public.

Description

Doing a call on a getter does not yield the return type of that getter. Committed: https://code.google.com/p/dart/source/detail?r=24250

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -0 lines) Patch
M sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart View 1 chunk +4 lines, -0 lines 1 comment Download
M tests/compiler/dart2js/simple_inferrer_test.dart View 4 chunks +6 lines, -0 lines 2 comments Download

Messages

Total messages: 4 (0 generated)
ngeoffray
Dan, hopefully this should fix your problem. Do you know how to patch in this ...
7 years, 6 months ago (2013-06-20 19:58:09 UTC) #1
ngeoffray
Committed patchset #1 manually as r24250 (presubmit successful).
7 years, 6 months ago (2013-06-20 20:24:36 UTC) #2
kasperl
Maybe this actually already works, but at least extending the test case would be good. ...
7 years, 6 months ago (2013-06-21 05:58:00 UTC) #3
ngeoffray
7 years, 6 months ago (2013-06-21 06:17:24 UTC) #4
Message was sent while issue was closed.
Fields don't have a return type, so it should return dynamic. Also, we iterate
over a FunctionSet of concrete elements (getters, fields, methods), so no
abstract field.

I will extend the test.

On 2013/06/21 05:58:00, kasperl wrote:
> Maybe this actually already works, but at least extending the test case would
be
> good.
> 
>
https://codereview.chromium.org/17502003/diff/1/sdk/lib/_internal/compiler/im...
> File
sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
> (right):
> 
>
https://codereview.chromium.org/17502003/diff/1/sdk/lib/_internal/compiler/im...
>
sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart:808:
> } else if (element.isGetter()) {
> What happens if element is a field? Can we ever get an abstract field here?
> 
>
https://codereview.chromium.org/17502003/diff/1/tests/compiler/dart2js/simple...
> File tests/compiler/dart2js/simple_inferrer_test.dart (right):
> 
>
https://codereview.chromium.org/17502003/diff/1/tests/compiler/dart2js/simple...
> tests/compiler/dart2js/simple_inferrer_test.dart:367:
> testReturnInvokeDynamicGetter() => new A().myFactory();
> Extend test case with calling a field.
> 
>
https://codereview.chromium.org/17502003/diff/1/tests/compiler/dart2js/simple...
> tests/compiler/dart2js/simple_inferrer_test.dart:391: get myFactory => () =>
42;
> var myFactory2 = () => 87;

Powered by Google App Engine
This is Rietveld 408576698