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

Unified Diff: tests/language/function_type_this_parameter_test.dart

Issue 10837167: Add failing test for initializing function parameters in constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update comment Created 8 years, 4 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 | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/function_type_this_parameter_test.dart
diff --git a/tests/language/compile_time_constant9_test.dart b/tests/language/function_type_this_parameter_test.dart
similarity index 56%
copy from tests/language/compile_time_constant9_test.dart
copy to tests/language/function_type_this_parameter_test.dart
index a149c43f11c1b94efb802fbad0ac84b423695504..cb7d6c5355adc345a401ee57d36d240bedc06a01 100644
--- a/tests/language/compile_time_constant9_test.dart
+++ b/tests/language/function_type_this_parameter_test.dart
@@ -1,16 +1,15 @@
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// 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.
-
-class B {
- const B();
-}
+// Check that function types are accepted for constructor arguments that
+// initialize fields.
class A {
- var x = const B();
- A();
+ Function f;
+ A(int this.f());
}
main() {
- Expect.isTrue(new A().x === new A().x);
+ var a = new A(() => 499);
+ Expect.equals(499, (a.f)());
}
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698