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

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

Issue 1699243003: Serialize and resynthesize unresolved constant instance creations. (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/test/src/summary/resynthesize_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart
index d6c1b518076f3521f7bf60f3f1745df58dfbfbd6..19a793ae2f4121a3642997ec0bb4cfdfdf5dd4af 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -477,6 +477,9 @@ class ResynthTest extends ResolverTestCase {
void compareConstructorElements(ConstructorElement resynthesized,
ConstructorElement original, String desc) {
+ if (original == null && resynthesized == null) {
+ return;
+ }
compareExecutableElements(resynthesized, original, desc);
if (original.isConst) {
ConstructorElementImpl resynthesizedImpl =
@@ -1457,6 +1460,23 @@ const V = const p.C.named();
''');
}
+ test_const_invokeConstructor_named_unresolved() {
+ checkLibrary(
+ r'''
+class C {}
+const V = const C.named();
+''',
+ allowErrors: true);
+ }
+
+ test_const_invokeConstructor_named_unresolved2() {
+ checkLibrary(
+ r'''
+const V = const C.named();
+''',
+ allowErrors: true);
+ }
+
Paul Berry 2016/02/16 20:44:10 Let's also add tests for cases involving prefixes,
scheglov 2016/02/16 21:48:44 Done.
test_const_invokeConstructor_unnamed() {
checkLibrary(r'''
class C {
@@ -1494,6 +1514,14 @@ const V = const p.C();
''');
}
+ test_const_invokeConstructor_unnamed_unresolved() {
+ checkLibrary(
+ r'''
+const V = const C();
+''',
+ allowErrors: true);
+ }
+
Paul Berry 2016/02/16 20:44:10 Similarly, also test the case: import 'a.dart' as
scheglov 2016/02/16 21:48:44 Done.
test_const_length_ofClassConstField() {
checkLibrary(r'''
class C {

Powered by Google App Engine
This is Rietveld 408576698