| Index: pkg/analyzer/test/src/dart/ast/utilities_test.dart
|
| diff --git a/pkg/analyzer/test/src/dart/ast/utilities_test.dart b/pkg/analyzer/test/src/dart/ast/utilities_test.dart
|
| index 2f077750c10d63f4c097ca6c25376b38278579fb..83a8b976b0c2ceae3db3b8991be557c38307d166 100644
|
| --- a/pkg/analyzer/test/src/dart/ast/utilities_test.dart
|
| +++ b/pkg/analyzer/test/src/dart/ast/utilities_test.dart
|
| @@ -2509,6 +2509,33 @@ class ToSourceVisitor2Test extends EngineTestCase {
|
| parameters: AstTestFactory.formalParameterList([])));
|
| }
|
|
|
| + void test_visitGenericFunctionType() {
|
| + _assertSource(
|
| + "int Function<T>(T)",
|
| + AstTestFactory.genericFunctionType(
|
| + AstTestFactory.typeName4("int"),
|
| + AstTestFactory.typeParameterList(['T']),
|
| + AstTestFactory.formalParameterList([
|
| + AstTestFactory.simpleFormalParameter4(
|
| + AstTestFactory.typeName4("T"), null)
|
| + ])));
|
| + }
|
| +
|
| + void test_visitGenericTypeAlias() {
|
| + _assertSource(
|
| + "typedef X<S> = S Function<T>(T)",
|
| + AstTestFactory.genericTypeAlias(
|
| + 'X',
|
| + AstTestFactory.typeParameterList(['S']),
|
| + AstTestFactory.genericFunctionType(
|
| + AstTestFactory.typeName4("S"),
|
| + AstTestFactory.typeParameterList(['T']),
|
| + AstTestFactory.formalParameterList([
|
| + AstTestFactory.simpleFormalParameter4(
|
| + AstTestFactory.typeName4("T"), null)
|
| + ]))));
|
| + }
|
| +
|
| void test_visitIfStatement_withElse() {
|
| _assertSource(
|
| "if (c) {} else {}",
|
| @@ -4858,6 +4885,33 @@ class ToSourceVisitorTest extends EngineTestCase {
|
| parameters: AstTestFactory.formalParameterList([])));
|
| }
|
|
|
| + void test_visitGenericFunctionType() {
|
| + _assertSource(
|
| + "int Function<T>(T)",
|
| + AstTestFactory.genericFunctionType(
|
| + AstTestFactory.typeName4("int"),
|
| + AstTestFactory.typeParameterList(['T']),
|
| + AstTestFactory.formalParameterList([
|
| + AstTestFactory.simpleFormalParameter4(
|
| + AstTestFactory.typeName4("T"), null)
|
| + ])));
|
| + }
|
| +
|
| + void test_visitGenericTypeAlias() {
|
| + _assertSource(
|
| + "typedef X<S> = S Function<T>(T)",
|
| + AstTestFactory.genericTypeAlias(
|
| + 'X',
|
| + AstTestFactory.typeParameterList(['S']),
|
| + AstTestFactory.genericFunctionType(
|
| + AstTestFactory.typeName4("S"),
|
| + AstTestFactory.typeParameterList(['T']),
|
| + AstTestFactory.formalParameterList([
|
| + AstTestFactory.simpleFormalParameter4(
|
| + AstTestFactory.typeName4("T"), null)
|
| + ]))));
|
| + }
|
| +
|
| void test_visitIfStatement_withElse() {
|
| _assertSource(
|
| "if (c) {} else {}",
|
|
|