| 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));
|
| +}
|
|
|