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

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

Issue 1685713002: Rework UnlinkedPublicName.constMembers. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
Index: pkg/analyzer/lib/src/summary/summarize_elements.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_elements.dart b/pkg/analyzer/lib/src/summary/summarize_elements.dart
index 168e91be31cbcef6b8994a6f9c974527394efb41..5f4dbca910344fe99c2c1a65b11e73a137cb55f9 100644
--- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
@@ -187,7 +187,7 @@ class _CompilationUnitSerializer {
kind: ReferenceKind.classOrEnum,
name: cls.name,
numTypeParameters: cls.typeParameters.length,
- constMembers: serializeClassConstMembers(cls)));
+ members: serializeClassConstMembers(cls)));
}
}
for (ClassElement enm in compilationUnit.enums) {
@@ -404,6 +404,12 @@ class _CompilationUnitSerializer {
* Otherwise return `null`.
*/
List<UnlinkedPublicNameBuilder> serializeClassConstMembers(ClassElement cls) {
+ if (cls.isMixinApplication) {
+ // Mixin application members can't be determined directly from the AST so
+ // we can't store them in UnlinkedPublicName.
+ // TODO(paulberry): find somewhere else to store them.
+ return null;
+ }
if (cls.kind == ElementKind.CLASS) {
List<UnlinkedPublicNameBuilder> bs = <UnlinkedPublicNameBuilder>[];
for (FieldElement field in cls.fields) {
@@ -425,7 +431,8 @@ class _CompilationUnitSerializer {
}
}
for (ConstructorElement constructor in cls.constructors) {
- if (constructor.isConst && constructor.isPublic) {
+ if (constructor.isPublic &&
+ constructor.name.isNotEmpty) {
// TODO(paulberry): should numTypeParameters include class params?
bs.add(new UnlinkedPublicNameBuilder(
name: constructor.name,
« no previous file with comments | « pkg/analyzer/lib/src/summary/public_namespace_computer.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698