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

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

Issue 1713753002: Allow linked types to refer to local executables. (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 1b3ff51c5f220e37a6e7fe79ad99ae763f15a660..f3139e9e824651ff87e0023422913cd261b284b1 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -1324,6 +1324,15 @@ class E {}''');
checkLibrary('class C {} class D {}');
}
+ test_closure_executable_with_return_type_from_closure() {
+ checkLibrary('''
+f() {
+ print(() {});
+ print(() => () => 0);
+}
+''');
+ }
+
test_const_invalid_field_const() {
constantInitializersAreInvalid = true;
checkLibrary(
@@ -2814,6 +2823,27 @@ get x => null;''');
' abstract class D { void set f(int g(String s)); }');
}
+ test_initializer_executable_with_return_type_from_closure() {
+ checkLibrary('var v = () => 0;');
+ }
+
+ test_initializer_executable_with_return_type_from_closure_field() {
+ checkLibrary('''
+class C {
+ var v = () => 0;
+}
+''');
+ }
+
+ test_initializer_executable_with_return_type_from_closure_local() {
+ checkLibrary('''
+void f() {
+ int u = 0;
+ var v = () => 0;
+}
+''');
+ }
+
test_library() {
checkLibrary('');
}
@@ -3305,6 +3335,15 @@ void named({x: 1}) {}
checkLibrary('library my.lib; part "a.dart"; part "b.dart";');
}
+ test_propagated_type_refers_to_closure() {
+ checkLibrary('''
+void f() {
+ var x = () => 0;
+ var y = x;
+}
+''');
+ }
+
test_setter_documented() {
checkLibrary('''
// Extra comment so doc comment offset != 0

Powered by Google App Engine
This is Rietveld 408576698