| Index: tests/language/type_check_const_function_typedef2_test.dart
|
| diff --git a/tests/language/type_check_const_function_typedef2_test.dart b/tests/language/type_check_const_function_typedef2_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..fa9609b565f527ad7cb8ddbbaaefdc762a7d1ca6
|
| --- /dev/null
|
| +++ b/tests/language/type_check_const_function_typedef2_test.dart
|
| @@ -0,0 +1,25 @@
|
| +// Copyright (c) 2014, 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.
|
| +
|
| +// Tests that typechecks on const objects with typedefs work.
|
| +
|
| +import "package:expect/expect.dart";
|
| +
|
| +typedef String Int2String(int x);
|
| +
|
| +class A {
|
| + final Int2String f;
|
| + const A(this.f);
|
| +}
|
| +
|
| +int /// 00: compile-time error
|
| +foo(
|
| +String /// 00: continued
|
| +x) => 499;
|
| +
|
| +const a = const A(foo);
|
| +
|
| +main() {
|
| + Expect.equals(499, a.f(499));
|
| +}
|
|
|