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

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

Issue 2777783003: Record variable names in type inference cycles. (Closed)
Patch Set: Created 3 years, 9 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/format.fbs » ('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 680c69441ddd20dabfa99cdc5c7542a199fd9bd5..3003162c59005909af3de2b047d03adac80612e3 100644
--- a/pkg/analyzer/lib/src/summary/format.dart
+++ b/pkg/analyzer/lib/src/summary/format.dart
@@ -4721,10 +4721,21 @@ abstract class _PackageIndexMixin implements idl.PackageIndex {
class TopLevelInferenceErrorBuilder extends Object
with _TopLevelInferenceErrorMixin
implements idl.TopLevelInferenceError {
+ List<String> _arguments;
idl.TopLevelInferenceErrorKind _kind;
int _slot;
@override
+ List<String> get arguments => _arguments ??= <String>[];
+
+ /**
+ * The [kind] specific arguments.
+ */
+ void set arguments(List<String> value) {
+ this._arguments = value;
+ }
+
+ @override
idl.TopLevelInferenceErrorKind get kind =>
_kind ??= idl.TopLevelInferenceErrorKind.assignment;
@@ -4748,8 +4759,10 @@ class TopLevelInferenceErrorBuilder extends Object
this._slot = value;
}
- TopLevelInferenceErrorBuilder({idl.TopLevelInferenceErrorKind kind, int slot})
- : _kind = kind,
+ TopLevelInferenceErrorBuilder(
+ {List<String> arguments, idl.TopLevelInferenceErrorKind kind, int slot})
+ : _arguments = arguments,
+ _kind = kind,
_slot = slot;
/**
@@ -4763,10 +4776,26 @@ class TopLevelInferenceErrorBuilder extends Object
void collectApiSignature(api_sig.ApiSignature signature) {
signature.addInt(this._slot ?? 0);
signature.addInt(this._kind == null ? 0 : this._kind.index);
+ if (this._arguments == null) {
+ signature.addInt(0);
+ } else {
+ signature.addInt(this._arguments.length);
+ for (var x in this._arguments) {
+ signature.addString(x);
+ }
+ }
}
fb.Offset finish(fb.Builder fbBuilder) {
+ fb.Offset offset_arguments;
+ if (!(_arguments == null || _arguments.isEmpty)) {
+ offset_arguments = fbBuilder
+ .writeList(_arguments.map((b) => fbBuilder.writeString(b)).toList());
+ }
fbBuilder.startTable();
+ if (offset_arguments != null) {
+ fbBuilder.addOffset(2, offset_arguments);
+ }
if (_kind != null && _kind != idl.TopLevelInferenceErrorKind.assignment) {
fbBuilder.addUint8(1, _kind.index);
}
@@ -4794,10 +4823,18 @@ class _TopLevelInferenceErrorImpl extends Object
_TopLevelInferenceErrorImpl(this._bc, this._bcOffset);
+ List<String> _arguments;
idl.TopLevelInferenceErrorKind _kind;
int _slot;
@override
+ List<String> get arguments {
+ _arguments ??= const fb.ListReader<String>(const fb.StringReader())
+ .vTableGet(_bc, _bcOffset, 2, const <String>[]);
+ return _arguments;
+ }
+
+ @override
idl.TopLevelInferenceErrorKind get kind {
_kind ??= const _TopLevelInferenceErrorKindReader().vTableGet(
_bc, _bcOffset, 1, idl.TopLevelInferenceErrorKind.assignment);
@@ -4816,6 +4853,7 @@ abstract class _TopLevelInferenceErrorMixin
@override
Map<String, Object> toJson() {
Map<String, Object> _result = <String, Object>{};
+ if (arguments.isNotEmpty) _result["arguments"] = arguments;
if (kind != idl.TopLevelInferenceErrorKind.assignment)
_result["kind"] = kind.toString().split('.')[1];
if (slot != 0) _result["slot"] = slot;
@@ -4824,6 +4862,7 @@ abstract class _TopLevelInferenceErrorMixin
@override
Map<String, Object> toMap() => {
+ "arguments": arguments,
"kind": kind,
"slot": slot,
};
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/format.fbs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698