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

Unified Diff: pkg/analyzer/test/src/summary/summary_test.dart

Issue 1533563003: Fix resynthesis of operator[]= from summary. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/summary_test.dart
diff --git a/pkg/analyzer/test/src/summary/summary_test.dart b/pkg/analyzer/test/src/summary/summary_test.dart
index c20532b3593db54c1b585b58af2ad0fc151382cf..854b0a815b8ad3f50a76620e888faac21d3a6a20 100644
--- a/pkg/analyzer/test/src/summary/summary_test.dart
+++ b/pkg/analyzer/test/src/summary/summary_test.dart
@@ -1214,6 +1214,37 @@ typedef F();
expect(executable.isStatic, isFalse);
}
+ test_executable_operator_index() {
+ UnlinkedExecutable executable =
+ serializeClassText('class C { bool operator[](int i) => null; }')
+ .executables[0];
+ expect(executable.kind, UnlinkedExecutableKind.functionOrMethod);
+ expect(executable.name, '[]');
+ expect(executable.hasImplicitReturnType, false);
+ expect(executable.isAbstract, false);
+ expect(executable.isConst, false);
+ expect(executable.isFactory, false);
+ expect(executable.isStatic, false);
+ expect(executable.parameters, hasLength(1));
+ checkTypeRef(executable.returnType, 'dart:core', 'dart:core', 'bool');
+ expect(executable.typeParameters, isEmpty);
+ }
+
+ test_executable_operator_index_set() {
+ UnlinkedExecutable executable = serializeClassText(
+ 'class C { void operator[]=(int i, bool v) => null; }').executables[0];
+ expect(executable.kind, UnlinkedExecutableKind.functionOrMethod);
+ expect(executable.name, '[]=');
+ expect(executable.hasImplicitReturnType, false);
+ expect(executable.isAbstract, false);
+ expect(executable.isConst, false);
+ expect(executable.isFactory, false);
+ expect(executable.isStatic, false);
+ expect(executable.parameters, hasLength(2));
+ expect(executable.returnType, isNull);
+ expect(executable.typeParameters, isEmpty);
+ }
+
test_executable_param_function_typed() {
UnlinkedExecutable executable = serializeExecutableText('f(g()) {}');
expect(executable.parameters[0].isFunctionTyped, isTrue);
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698