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

Unified Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 1577033002: Fix for resynthesizing implicit top-level variables. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index 5b3b24e41d7330e4d16d6df4a318f8b8bf92c1ed..a8525cb6ff41789a6d4f7ac01353681f51009e06 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -599,18 +599,17 @@ class _LibraryResynthesizer {
*/
PropertyInducingElementImpl buildImplicitTopLevelVariable(
String name, UnlinkedExecutableKind kind, ElementHolder holder) {
- if (holder.getTopLevelVariable(name) == null) {
- TopLevelVariableElementImpl variable =
- new TopLevelVariableElementImpl(name, -1);
+ TopLevelVariableElementImpl variable = holder.getTopLevelVariable(name);
+ if (variable == null) {
+ variable = new TopLevelVariableElementImpl(name, -1);
variable.synthetic = true;
variable.final2 = kind == UnlinkedExecutableKind.getter;
holder.addTopLevelVariable(variable);
return variable;
} else {
- // TODO(paulberry): if adding a setter where there was previously
- // only a getter, remove "final" modifier.
// TODO(paulberry): what if the getter and setter have a type mismatch?
- throw new UnimplementedError();
+ variable.final2 = false;
+ return variable;
}
}
@@ -778,7 +777,8 @@ class _LibraryResynthesizer {
if (type.paramReference != 0) {
// TODO(paulberry): make this work for generic methods.
return currentTypeParameters[
- currentTypeParameters.length - type.paramReference].type;
+ currentTypeParameters.length - type.paramReference]
+ .type;
} else {
// TODO(paulberry): handle references to things other than classes (note:
// this should only occur in the case of erroneous code).
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698