| Index: pkg/analyzer/test/generated/strong_mode_test.dart
|
| diff --git a/pkg/analyzer/test/generated/strong_mode_test.dart b/pkg/analyzer/test/generated/strong_mode_test.dart
|
| index dab4bab51d151d4ae5e9d66093f72b1d1d335bbc..ca85297eea9779937e3661940d2033c195fdf111 100644
|
| --- a/pkg/analyzer/test/generated/strong_mode_test.dart
|
| +++ b/pkg/analyzer/test/generated/strong_mode_test.dart
|
| @@ -3154,6 +3154,30 @@ void test() {
|
| expectIdentifierType('cc', "C<int, B<int>, A<dynamic>>");
|
| }
|
|
|
| + test_inferClosureType_parameters() async {
|
| + Source source = addSource(r'''
|
| +typedef F({bool p});
|
| +foo(callback(F f)) {}
|
| +main() {
|
| + foo((f) {
|
| + f(p: false);
|
| + });
|
| +}
|
| +''');
|
| + var result = await computeAnalysisResult(source);
|
| + var main = result.unit.declarations[2] as FunctionDeclaration;
|
| + var body = main.functionExpression.body as BlockFunctionBody;
|
| + var statement = body.block.statements[0] as ExpressionStatement;
|
| + var invocation = statement.expression as MethodInvocation;
|
| + var closure = invocation.argumentList.arguments[0] as FunctionExpression;
|
| + var closureType = closure.staticType as FunctionType;
|
| + var fType = closureType.parameters[0].type as FunctionType;
|
| + // The inferred type of "f" in "foo()" invocation must own its parameters.
|
| + ParameterElement p = fType.parameters[0];
|
| + expect(p.name, 'p');
|
| + expect(p.enclosingElement, same(fType.element));
|
| + }
|
| +
|
| @failingTest
|
| test_instantiateToBounds_class_error_extension_malbounded() async {
|
| // Test that superclasses are strictly checked for malbounded default
|
|
|