| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer.test.generated.parser_test; | 5 library analyzer.test.generated.parser_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/visitor.dart'; | 8 import 'package:analyzer/dart/ast/visitor.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 7118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7129 } | 7129 } |
| 7130 | 7130 |
| 7131 void test_parseCompilationUnitMember_function_generic_noReturnType() { | 7131 void test_parseCompilationUnitMember_function_generic_noReturnType() { |
| 7132 enableGenericMethods = true; | 7132 enableGenericMethods = true; |
| 7133 FunctionDeclaration declaration = parse("parseCompilationUnitMember", | 7133 FunctionDeclaration declaration = parse("parseCompilationUnitMember", |
| 7134 <Object>[emptyCommentAndMetadata()], "f<E>() {}"); | 7134 <Object>[emptyCommentAndMetadata()], "f<E>() {}"); |
| 7135 expect(declaration.returnType, isNull); | 7135 expect(declaration.returnType, isNull); |
| 7136 expect(declaration.functionExpression.typeParameters, isNotNull); | 7136 expect(declaration.functionExpression.typeParameters, isNotNull); |
| 7137 } | 7137 } |
| 7138 | 7138 |
| 7139 void |
| 7140 test_parseCompilationUnitMember_function_generic_noReturnType_annotated()
{ |
| 7141 enableGenericMethods = true; |
| 7142 FunctionDeclaration declaration = parse("parseCompilationUnitMember", |
| 7143 <Object>[emptyCommentAndMetadata()], "f<@a E>() {}"); |
| 7144 expect(declaration.returnType, isNull); |
| 7145 expect(declaration.functionExpression.typeParameters, isNotNull); |
| 7146 } |
| 7147 |
| 7139 void test_parseCompilationUnitMember_function_generic_returnType() { | 7148 void test_parseCompilationUnitMember_function_generic_returnType() { |
| 7140 enableGenericMethods = true; | 7149 enableGenericMethods = true; |
| 7141 FunctionDeclaration declaration = parse("parseCompilationUnitMember", | 7150 FunctionDeclaration declaration = parse("parseCompilationUnitMember", |
| 7142 <Object>[emptyCommentAndMetadata()], "E f<E>() {}"); | 7151 <Object>[emptyCommentAndMetadata()], "E f<E>() {}"); |
| 7143 expect(declaration.returnType, isNotNull); | 7152 expect(declaration.returnType, isNotNull); |
| 7144 expect(declaration.functionExpression.typeParameters, isNotNull); | 7153 expect(declaration.functionExpression.typeParameters, isNotNull); |
| 7145 } | 7154 } |
| 7146 | 7155 |
| 7147 void test_parseCompilationUnitMember_function_generic_void() { | 7156 void test_parseCompilationUnitMember_function_generic_void() { |
| 7148 enableGenericMethods = true; | 7157 enableGenericMethods = true; |
| (...skipping 4344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11493 new Scanner(null, new CharSequenceReader(source), listener); | 11502 new Scanner(null, new CharSequenceReader(source), listener); |
| 11494 Token tokenStream = scanner.tokenize(); | 11503 Token tokenStream = scanner.tokenize(); |
| 11495 // | 11504 // |
| 11496 // Parse the source. | 11505 // Parse the source. |
| 11497 // | 11506 // |
| 11498 Parser parser = new Parser(null, listener); | 11507 Parser parser = new Parser(null, listener); |
| 11499 return invokeParserMethodImpl( | 11508 return invokeParserMethodImpl( |
| 11500 parser, methodName, <Object>[tokenStream], tokenStream) as Token; | 11509 parser, methodName, <Object>[tokenStream], tokenStream) as Token; |
| 11501 } | 11510 } |
| 11502 } | 11511 } |
| OLD | NEW |