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

Unified Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 2594873002: Make call methods definite. (Closed)
Patch Set: Rebase Created 3 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 | « pkg/analyzer/lib/src/task/strong/checker.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/task/strong/checker_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index 8ebcd1c92ef1a8ce143ea61bfbb49fed5da8c543..e8f9b0e4b066c5273e20f1ec8f8349482d68debc 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -1301,9 +1301,10 @@ void main() {
}
void test_functionTypingAndSubtyping_dynamicFunctions_closuresAreNotFuzzy() {
- // Regression test for
+ // Regression test for definite function cases
// https://github.com/dart-lang/sdk/issues/26118
// https://github.com/dart-lang/sdk/issues/26156
+ // https://github.com/dart-lang/sdk/issues/28087
checkFile('''
void takesF(void f(int x)) {}
@@ -1313,20 +1314,27 @@ void update(_) {}
void updateOpt([_]) {}
void updateOptNum([num x]) {}
+class Callable {
+ void call(_) {}
+}
+
class A {
TakesInt f;
A(TakesInt g) {
f = update;
f = updateOpt;
f = updateOptNum;
+ f = new Callable();
}
TakesInt g(bool a, bool b) {
if (a) {
return update;
} else if (b) {
return updateOpt;
- } else {
+ } else if (a) {
return updateOptNum;
+ } else {
+ return new Callable();
}
}
}
@@ -1335,13 +1343,16 @@ void test0() {
takesF(update);
takesF(updateOpt);
takesF(updateOptNum);
+ takesF(new Callable());
TakesInt f;
f = update;
f = updateOpt;
f = updateOptNum;
+ f = new Callable();
new A(update);
new A(updateOpt);
new A(updateOptNum);
+ new A(new Callable());
}
void test1() {
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698