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

Issue 644283002: Type check field assignments during constant evaluation. (Closed)

Created:
6 years, 2 months ago by Paul Berry
Modified:
6 years, 2 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Type check field assignments during constant evaluation. BUG=dartbug.com/16391 R=scheglov@google.com Committed: https://code.google.com/p/dart/source/detail?r=41062

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -8 lines) Patch
M pkg/analyzer/lib/src/generated/constant.dart View 1 chunk +8 lines, -0 lines 2 comments Download
M pkg/analyzer/lib/src/generated/error.dart View 6 chunks +17 lines, -6 lines 0 comments Download
M pkg/analyzer/lib/src/generated/resolver.dart View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/analyzer/test/generated/resolver_test.dart View 1 chunk +25 lines, -0 lines 0 comments Download
M tests/language/language_analyzer2.status View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
Paul Berry
6 years, 2 months ago (2014-10-11 16:38:19 UTC) #2
scheglov
LGTM
6 years, 2 months ago (2014-10-11 19:44:57 UTC) #3
Paul Berry
Committed patchset #1 (id:1) manually as 41062 (presubmit successful).
6 years, 2 months ago (2014-10-11 21:25:16 UTC) #4
Brian Wilkerson
https://codereview.chromium.org/644283002/diff/1/pkg/analyzer/lib/src/generated/constant.dart File pkg/analyzer/lib/src/generated/constant.dart (right): https://codereview.chromium.org/644283002/diff/1/pkg/analyzer/lib/src/generated/constant.dart#newcode778 pkg/analyzer/lib/src/generated/constant.dart:778: PropertyAccessorElement getter = definingClass.getGetter(fieldName); Seems like we should need ...
6 years, 2 months ago (2014-10-12 20:20:42 UTC) #5
Paul Berry
6 years, 2 months ago (2014-10-13 15:55:33 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/644283002/diff/1/pkg/analyzer/lib/src/generat...
File pkg/analyzer/lib/src/generated/constant.dart (right):

https://codereview.chromium.org/644283002/diff/1/pkg/analyzer/lib/src/generat...
pkg/analyzer/lib/src/generated/constant.dart:778: PropertyAccessorElement getter
= definingClass.getGetter(fieldName);
On 2014/10/12 20:20:42, Brian Wilkerson wrote:
> Seems like we should need to check for "getter != null" before using it. In
> invalid code we can have a field initializer that doesn't correspond to a
field.
> We might also want to confirm that the field is not synthetic and refrain from
> issuing an error in that case.

That's a good point.  I'll add tests for these cases and fix the code as
necessary.

Powered by Google App Engine
This is Rietveld 408576698