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.src.generated.error_verifier; | 5 library analyzer.src.generated.error_verifier; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import "dart:math" as math; | 8 import "dart:math" as math; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 _computeReturnTypeForMethod(null), expectedReturnType)) { | 1921 _computeReturnTypeForMethod(null), expectedReturnType)) { |
1922 return false; | 1922 return false; |
1923 } | 1923 } |
1924 _hasReturnWithoutValue = true; | 1924 _hasReturnWithoutValue = true; |
1925 _errorReporter.reportErrorForNode( | 1925 _errorReporter.reportErrorForNode( |
1926 StaticWarningCode.RETURN_WITHOUT_VALUE, statement); | 1926 StaticWarningCode.RETURN_WITHOUT_VALUE, statement); |
1927 return true; | 1927 return true; |
1928 } else if (_inGenerator) { | 1928 } else if (_inGenerator) { |
1929 // RETURN_IN_GENERATOR | 1929 // RETURN_IN_GENERATOR |
1930 _errorReporter.reportErrorForNode( | 1930 _errorReporter.reportErrorForNode( |
1931 CompileTimeErrorCode.RETURN_IN_GENERATOR, statement); | 1931 CompileTimeErrorCode.RETURN_IN_GENERATOR, |
| 1932 statement, |
| 1933 [_inAsync ? "async*" : "sync*"]); |
1932 } | 1934 } |
1933 // RETURN_OF_INVALID_TYPE | 1935 // RETURN_OF_INVALID_TYPE |
1934 return _checkForReturnOfInvalidType(returnExpression, expectedReturnType); | 1936 return _checkForReturnOfInvalidType(returnExpression, expectedReturnType); |
1935 } | 1937 } |
1936 | 1938 |
1937 /** | 1939 /** |
1938 * Verify that the export namespace of the given export [directive] does not | 1940 * Verify that the export namespace of the given export [directive] does not |
1939 * export any name already exported by another export directive. The | 1941 * export any name already exported by another export directive. The |
1940 * [exportElement] is the [ExportElement] retrieved from the node. If the | 1942 * [exportElement] is the [ExportElement] retrieved from the node. If the |
1941 * element in the node was `null`, then this method is not called. The | 1943 * element in the node was `null`, then this method is not called. The |
(...skipping 4263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6205 toCheck.add(type.element); | 6207 toCheck.add(type.element); |
6206 // type arguments | 6208 // type arguments |
6207 if (type is InterfaceType) { | 6209 if (type is InterfaceType) { |
6208 InterfaceType interfaceType = type; | 6210 InterfaceType interfaceType = type; |
6209 for (DartType typeArgument in interfaceType.typeArguments) { | 6211 for (DartType typeArgument in interfaceType.typeArguments) { |
6210 _addTypeToCheck(typeArgument); | 6212 _addTypeToCheck(typeArgument); |
6211 } | 6213 } |
6212 } | 6214 } |
6213 } | 6215 } |
6214 } | 6216 } |
OLD | NEW |