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

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2983773002: Resynthesize expressions for Kernel's StaticGet and PropertyGet. (Closed)
Patch Set: Resynthesize ClassName.StaticElement for Kernel. Created 3 years, 5 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_common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/element.dart
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 8dff6d78e307d87c97785835869f04fb717063c0..99d50034ae71babae1b2f1ea90b5761e71d13744 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -1823,7 +1823,7 @@ class CompilationUnitElementImpl extends UriReferencedElementImpl
return typeImpl;
}
}
- for (ClassElement type in _enums) {
+ for (ClassElement type in enums) {
EnumElementImpl typeImpl = type;
if (typeImpl.identifier == identifier) {
return typeImpl;
@@ -1919,6 +1919,13 @@ class ConstFieldElementImpl extends FieldElementImpl with ConstVariableElement {
ConstFieldElementImpl.forSerialized(
UnlinkedVariable unlinkedVariable, ElementImpl enclosingElement)
: super.forSerialized(unlinkedVariable, enclosingElement);
+
+ /**
+ * Initialize using the given kernel.
+ */
+ ConstFieldElementImpl.forKernel(
+ ElementImpl enclosingElement, kernel.Field kernel)
+ : super.forKernel(enclosingElement, kernel);
}
/**
@@ -4337,18 +4344,21 @@ class FieldElementImpl extends PropertyInducingElementImpl
FieldElementImpl(String name, int offset) : super(name, offset);
/**
- * Initialize using the given serialized information.
+ * Initialize using the given kernel.
*/
FieldElementImpl.forKernel(ElementImpl enclosingElement, kernel.Field kernel)
: super.forKernel(enclosingElement, kernel);
/**
- * Initialize using the given serialized information.
+ * Initialize using the given kernel.
*/
factory FieldElementImpl.forKernelFactory(
ClassElementImpl enclosingClass, kernel.Field kernel) {
- // TODO(scheglov) add support for constants.
- return new FieldElementImpl.forKernel(enclosingClass, kernel);
+ if (kernel.isConst) {
+ return new ConstFieldElementImpl.forKernel(enclosingClass, kernel);
+ } else {
+ return new FieldElementImpl.forKernel(enclosingClass, kernel);
+ }
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698