Chromium Code Reviews| Index: tests/lib/mirrors/function_type_mirror_test.dart |
| diff --git a/tests/lib/mirrors/function_type_mirror_test.dart b/tests/lib/mirrors/function_type_mirror_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1ec74f029da7f715fb7abc6fc23785e18e474792 |
| --- /dev/null |
| +++ b/tests/lib/mirrors/function_type_mirror_test.dart |
| @@ -0,0 +1,19 @@ |
| +// Copyright (c) 2013, 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. |
| + |
| +import "dart:mirrors"; |
| + |
| +import "package:expect/expect.dart"; |
| + |
| +typedef void FooFunction(int a, double b); |
| + |
| +main() { |
| + // Right now we can only get to a FunctionTypeMirror by reflecting on a |
| + // typedef. See issue 12135. |
| + TypedefMirror tm = reflectClass(FooFunction); |
| + FunctionTypeMirror ftm = tm.referent; |
|
ahe
2013/08/06 11:10:06
What is tm.referent? It is not in the API.
rmacnak
2013/08/06 16:32:40
Hm, the API calls this value.
ahe
2013/08/06 16:41:10
On which line in https://code.google.com/p/dart/so
|
| + Expect.equals(const Symbol("void"), ftm.returnType.simpleName); |
| + Expect.equals(const Symbol("int"), ftm.parameters[0].type.simpleName); |
| + Expect.equals(const Symbol("double"), ftm.parameters[1].type.simpleName); |
| +} |