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

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

Issue 1558353003: Add a count of type parameters to UnlinkedPublicName. (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/lib/src/summary/public_namespace_computer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/format.dart
diff --git a/pkg/analyzer/lib/src/summary/format.dart b/pkg/analyzer/lib/src/summary/format.dart
index 25e5649137766ec9baf989dc96c6ae1010151db6..adbb1eeb15ffc09fb99d115624a3254aa1159c92 100644
--- a/pkg/analyzer/lib/src/summary/format.dart
+++ b/pkg/analyzer/lib/src/summary/format.dart
@@ -1696,15 +1696,18 @@ UnlinkedPartBuilder encodeUnlinkedPart(base.BuilderContext builderContext, {Stri
class UnlinkedPublicName extends base.SummaryClass {
String _name;
PrelinkedReferenceKind _kind;
+ int _numTypeParameters;
UnlinkedPublicName.fromJson(Map json)
: _name = json["name"],
- _kind = json["kind"] == null ? null : PrelinkedReferenceKind.values[json["kind"]];
+ _kind = json["kind"] == null ? null : PrelinkedReferenceKind.values[json["kind"]],
+ _numTypeParameters = json["numTypeParameters"];
@override
Map<String, Object> toMap() => {
"name": name,
"kind": kind,
+ "numTypeParameters": numTypeParameters,
};
/**
@@ -1716,6 +1719,12 @@ class UnlinkedPublicName extends base.SummaryClass {
* The kind of object referred to by the name.
*/
PrelinkedReferenceKind get kind => _kind ?? PrelinkedReferenceKind.classOrEnum;
+
+ /**
+ * If the entity being referred to is generic, the number of type parameters
+ * it accepts. Otherwise zero.
+ */
+ int get numTypeParameters => _numTypeParameters ?? 0;
}
class UnlinkedPublicNameBuilder {
@@ -1747,6 +1756,18 @@ class UnlinkedPublicNameBuilder {
}
}
+ /**
+ * If the entity being referred to is generic, the number of type parameters
+ * it accepts. Otherwise zero.
+ */
+ void set numTypeParameters(int _value) {
+ assert(!_finished);
+ assert(!_json.containsKey("numTypeParameters"));
+ if (_value != null) {
+ _json["numTypeParameters"] = _value;
+ }
+ }
+
Map finish() {
assert(!_finished);
_finished = true;
@@ -1754,10 +1775,11 @@ class UnlinkedPublicNameBuilder {
}
}
-UnlinkedPublicNameBuilder encodeUnlinkedPublicName(base.BuilderContext builderContext, {String name, PrelinkedReferenceKind kind}) {
+UnlinkedPublicNameBuilder encodeUnlinkedPublicName(base.BuilderContext builderContext, {String name, PrelinkedReferenceKind kind, int numTypeParameters}) {
UnlinkedPublicNameBuilder builder = new UnlinkedPublicNameBuilder(builderContext);
builder.name = name;
builder.kind = kind;
+ builder.numTypeParameters = numTypeParameters;
return builder;
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/public_namespace_computer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698