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

Issue 2946733003: Fix type inference of getters that "override" setters and vice versa. (Closed)

Created:
3 years, 6 months ago by Paul Berry
Modified:
3 years, 5 months ago
CC:
reviews_dartlang.org, dart-fe-team+reviews_google.com, scheglov
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix type inference of getters that "override" setters and vice versa. Normally getters and setters are considered distinct and unrelated by the type inference algorithm. However, if a getter has no declared type and doesn't override anything, then we fall back on inferring its type from an inherited setter, and vice versa. R=sigmund@google.com Committed: https://github.com/dart-lang/sdk/commit/be01632bc04770e523360a6d806c025be857da48

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address code review comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+246 lines, -32 lines) Patch
M pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart View 2 chunks +12 lines, -0 lines 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart View 1 chunk +7 lines, -0 lines 0 comments Download
M pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart View 1 3 chunks +8 lines, -4 lines 0 comments Download
M pkg/front_end/test/fasta/kompile.status View 2 chunks +2 lines, -0 lines 0 comments Download
M pkg/front_end/test/fasta/strong.status View 1 chunk +0 lines, -1 line 0 comments Download
A pkg/front_end/testcases/inference/infer_final_field_setter_only.dart.strong.expect View 1 chunk +17 lines, -0 lines 0 comments Download
A pkg/front_end/testcases/inference/infer_getter_cross_to_setter.dart View 1 chunk +16 lines, -0 lines 0 comments Download
A pkg/front_end/testcases/inference/infer_getter_cross_to_setter.dart.direct.expect View 1 chunk +17 lines, -0 lines 0 comments Download
A pkg/front_end/testcases/inference/infer_getter_cross_to_setter.dart.outline.expect View 1 chunk +16 lines, -0 lines 0 comments Download
A pkg/front_end/testcases/inference/infer_getter_cross_to_setter.dart.strong.expect View 1 chunk +17 lines, -0 lines 0 comments Download
A pkg/front_end/testcases/inference/infer_setter_cross_to_getter.dart View 1 chunk +16 lines, -0 lines 0 comments Download
A pkg/front_end/testcases/inference/infer_setter_cross_to_getter.dart.direct.expect View 1 chunk +17 lines, -0 lines 0 comments Download
A pkg/front_end/testcases/inference/infer_setter_cross_to_getter.dart.outline.expect View 1 chunk +16 lines, -0 lines 0 comments Download
A pkg/front_end/testcases/inference/infer_setter_cross_to_getter.dart.strong.expect View 1 chunk +17 lines, -0 lines 0 comments Download
M pkg/kernel/lib/class_hierarchy.dart View 1 3 chunks +38 lines, -10 lines 2 comments Download
M pkg/kernel/lib/src/incremental_class_hierarchy.dart View 3 chunks +19 lines, -7 lines 0 comments Download
M pkg/kernel/test/class_hierarchy_test.dart View 2 chunks +11 lines, -10 lines 0 comments Download

Messages

Total messages: 9 (3 generated)
Paul Berry
Siggi to review front_end changes and do preliminary west coast review of kernel changes (Konstantin ...
3 years, 6 months ago (2017-06-19 18:28:35 UTC) #2
Siggi Cherem (dart-lang)
lgtm (although I'm not as familiar with the type-inference implementation, so I'll be asking you ...
3 years, 6 months ago (2017-06-19 20:47:35 UTC) #3
Paul Berry
https://codereview.chromium.org/2946733003/diff/1/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart File pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart (right): https://codereview.chromium.org/2946733003/diff/1/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart#newcode169 pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart:169: // TODO(paulberry): support dependencies on getters/setters too. On 2017/06/19 ...
3 years, 6 months ago (2017-06-19 21:58:29 UTC) #4
Paul Berry
Committed patchset #2 (id:20001) manually as be01632bc04770e523360a6d806c025be857da48 (presubmit successful).
3 years, 6 months ago (2017-06-20 12:34:37 UTC) #6
scheglov
https://codereview.chromium.org/2946733003/diff/20001/pkg/kernel/lib/class_hierarchy.dart File pkg/kernel/lib/class_hierarchy.dart (right): https://codereview.chromium.org/2946733003/diff/20001/pkg/kernel/lib/class_hierarchy.dart#newcode138 pkg/kernel/lib/class_hierarchy.dart:138: /// By default getters and setters are overridden separately. ...
3 years, 5 months ago (2017-06-26 20:29:12 UTC) #8
Paul Berry
3 years, 5 months ago (2017-06-27 20:53:30 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/2946733003/diff/20001/pkg/kernel/lib/class_hi...
File pkg/kernel/lib/class_hierarchy.dart (right):

https://codereview.chromium.org/2946733003/diff/20001/pkg/kernel/lib/class_hi...
pkg/kernel/lib/class_hierarchy.dart:138: /// By default getters and setters are
overridden separately.  The [isSetter]
On 2017/06/26 20:29:12, scheglov wrote:
> "By default getters and setters are overridden separately." does not seem
useful
> here.
> This method is exactly for crossing getters and setters.

Thanks!  https://codereview.chromium.org/2960033002/ should address this.

Powered by Google App Engine
This is Rietveld 408576698