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

Issue 2045693002: Fix @protected checks to play nice with generic supers (linter#257). (Closed)

Created:
4 years, 6 months ago by pquitslund
Modified:
4 years, 6 months ago
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix @protected checks to play nice with generic supers (linter#257). Fixes: https://github.com/dart-lang/linter/issues/257. (Pardon the member-sorting churn in `hint_code_test`.) BUG= R=scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/8b1440fd2b3208989af959e502c919c0c3396ed8

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -53 lines) Patch
M pkg/analyzer/lib/src/generated/resolver.dart View 1 chunk +11 lines, -3 lines 1 comment Download
M pkg/analyzer/test/generated/hint_code_test.dart View 6 chunks +73 lines, -50 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
pquitslund
4 years, 6 months ago (2016-06-06 19:54:46 UTC) #2
scheglov
lgtm
4 years, 6 months ago (2016-06-06 20:00:46 UTC) #3
pquitslund
Committed patchset #1 (id:1) manually as 8b1440fd2b3208989af959e502c919c0c3396ed8 (presubmit successful).
4 years, 6 months ago (2016-06-06 20:14:20 UTC) #5
Brian Wilkerson
lgtm with one exception https://codereview.chromium.org/2045693002/diff/1/pkg/analyzer/lib/src/generated/resolver.dart File pkg/analyzer/lib/src/generated/resolver.dart (right): https://codereview.chromium.org/2045693002/diff/1/pkg/analyzer/lib/src/generated/resolver.dart#newcode989 pkg/analyzer/lib/src/generated/resolver.dart:989: if (element.type == type) { ...
4 years, 6 months ago (2016-06-06 20:23:00 UTC) #6
pquitslund
4 years, 6 months ago (2016-06-06 20:46:46 UTC) #7
Message was sent while issue was closed.
On 2016/06/06 20:23:00, Brian Wilkerson wrote:
> lgtm with one exception
> 
>
https://codereview.chromium.org/2045693002/diff/1/pkg/analyzer/lib/src/genera...
> File pkg/analyzer/lib/src/generated/resolver.dart (right):
> 
>
https://codereview.chromium.org/2045693002/diff/1/pkg/analyzer/lib/src/genera...
> pkg/analyzer/lib/src/generated/resolver.dart:989: if (element.type == type) {
> I don't understand why this wouldn't be "element == typeElement". I don't know
> that it's possible for the 'type' to be something different from
'element.type',
> but I think the result would be wrong if it happened.

`allSupertypes` does not contain the `this` type.  Without an extra test, this
test would fail:

``
class A {
  int _a;
  @protected
  void set a(int a) { _a = a; }
  A(int a) {
    this.a = a; //<== wrongly annotated
  }
}
```

Having said that, I think you're right that `element == typeElement` is a better
approach. See: https://codereview.chromium.org/2047523002/ for a follow-up.

Thanks!

Powered by Google App Engine
This is Rietveld 408576698