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

Unified Diff: tests/language/type_check_const_function_typedef_test.dart

Issue 132313012: Fix typechecks for constant assignments of function to typedefs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file for analyzer. Created 6 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
« no previous file with comments | « tests/language/type_check_const_function_typedef2_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/type_check_const_function_typedef_test.dart
diff --git a/tests/compiler/dart2js_extra/16407_test.dart b/tests/language/type_check_const_function_typedef_test.dart
similarity index 51%
copy from tests/compiler/dart2js_extra/16407_test.dart
copy to tests/language/type_check_const_function_typedef_test.dart
index aff1ba337ddab1eb5d219ac635653b48d4f8d1bc..484c61aeef1a2f3230d5e97c1e6af609b5bac1b0 100644
--- a/tests/compiler/dart2js_extra/16407_test.dart
+++ b/tests/language/type_check_const_function_typedef_test.dart
@@ -2,15 +2,21 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// Tests that typechecks on const objects with typedefs work.
+
import "package:expect/expect.dart";
-// Regression test for Issue 16407.
+typedef String Int2String(int x);
-void main() {
- foo(null, true);
- foo('x', false);
+class A {
+ final Int2String f;
+ const A(this.f);
}
-var foo = (x, result) {
- Expect.equals(result, x is Null, '$x is Null');
-};
+String foo(int x) => "str";
+
+const a = const A(foo);
+
+main() {
+ Expect.equals("str", a.f(499));
+}
« no previous file with comments | « tests/language/type_check_const_function_typedef2_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698