| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 interface TreeElements { | 5 interface TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 DartType getType(TypeAnnotation annotation); | 8 DartType getType(TypeAnnotation annotation); |
| 9 bool isParameterChecked(Element element); | 9 bool isParameterChecked(Element element); |
| 10 } | 10 } |
| (...skipping 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1929 error(modifier, MessageKind.PARAMETER_WITH_MODIFIER_IN_CATCH); | 1929 error(modifier, MessageKind.PARAMETER_WITH_MODIFIER_IN_CATCH); |
| 1930 } | 1930 } |
| 1931 TypeAnnotation type = declaration.type; | 1931 TypeAnnotation type = declaration.type; |
| 1932 if (type !== null) { | 1932 if (type !== null) { |
| 1933 error(type, MessageKind.PARAMETER_WITH_TYPE_IN_CATCH); | 1933 error(type, MessageKind.PARAMETER_WITH_TYPE_IN_CATCH); |
| 1934 } | 1934 } |
| 1935 } | 1935 } |
| 1936 } | 1936 } |
| 1937 | 1937 |
| 1938 Scope blockScope = new BlockScope(scope); | 1938 Scope blockScope = new BlockScope(scope); |
| 1939 var wasTypeRequired = typeRequired; |
| 1940 typeRequired = true; |
| 1939 doInCheckContext(() => visitIn(node.type, blockScope)); | 1941 doInCheckContext(() => visitIn(node.type, blockScope)); |
| 1942 typeRequired = wasTypeRequired; |
| 1940 visitIn(node.formals, blockScope); | 1943 visitIn(node.formals, blockScope); |
| 1941 visitIn(node.block, blockScope); | 1944 visitIn(node.block, blockScope); |
| 1942 } | 1945 } |
| 1943 | 1946 |
| 1944 visitTypedef(Typedef node) { | 1947 visitTypedef(Typedef node) { |
| 1945 unimplemented(node, 'typedef'); | 1948 unimplemented(node, 'typedef'); |
| 1946 } | 1949 } |
| 1947 } | 1950 } |
| 1948 | 1951 |
| 1949 class TypeDefinitionVisitor extends CommonResolverVisitor<DartType> { | 1952 class TypeDefinitionVisitor extends CommonResolverVisitor<DartType> { |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2748 | 2751 |
| 2749 Element localLookup(SourceString name) => library.find(name); | 2752 Element localLookup(SourceString name) => library.find(name); |
| 2750 Element lookup(SourceString name) => localLookup(name); | 2753 Element lookup(SourceString name) => localLookup(name); |
| 2751 Element lexicalLookup(SourceString name) => localLookup(name); | 2754 Element lexicalLookup(SourceString name) => localLookup(name); |
| 2752 | 2755 |
| 2753 Element add(Element newElement) { | 2756 Element add(Element newElement) { |
| 2754 throw "Cannot add an element in the top scope"; | 2757 throw "Cannot add an element in the top scope"; |
| 2755 } | 2758 } |
| 2756 String toString() => '$element'; | 2759 String toString() => '$element'; |
| 2757 } | 2760 } |
| OLD | NEW |