| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.task.strong_mode; | 5 library analyzer.src.task.strong_mode; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 * instance members of some base class. | 74 * instance members of some base class. |
| 75 */ | 75 */ |
| 76 HashSet<ClassElementImpl> elementsBeingInferred = | 76 HashSet<ClassElementImpl> elementsBeingInferred = |
| 77 new HashSet<ClassElementImpl>(); | 77 new HashSet<ClassElementImpl>(); |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * Initialize a newly create inferrer. | 80 * Initialize a newly create inferrer. |
| 81 */ | 81 */ |
| 82 InstanceMemberInferrer(this.typeProvider, this.inheritanceManager, | 82 InstanceMemberInferrer(this.typeProvider, this.inheritanceManager, |
| 83 {TypeSystem typeSystem}) | 83 {TypeSystem typeSystem}) |
| 84 : typeSystem = (typeSystem != null) ? typeSystem : new TypeSystemImpl(); | 84 : typeSystem = (typeSystem != null) |
| 85 ? typeSystem |
| 86 : new TypeSystemImpl(typeProvider); |
| 85 | 87 |
| 86 /** | 88 /** |
| 87 * Infer type information for all of the instance members in the given | 89 * Infer type information for all of the instance members in the given |
| 88 * compilation [unit]. | 90 * compilation [unit]. |
| 89 */ | 91 */ |
| 90 void inferCompilationUnit(CompilationUnitElement unit) { | 92 void inferCompilationUnit(CompilationUnitElement unit) { |
| 91 for (ClassElement classElement in unit.types) { | 93 for (ClassElement classElement in unit.types) { |
| 92 try { | 94 try { |
| 93 _inferClass(classElement); | 95 _inferClass(classElement); |
| 94 } on _CycleException { | 96 } on _CycleException { |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 results.add(element); | 497 results.add(element); |
| 496 } | 498 } |
| 497 } | 499 } |
| 498 } | 500 } |
| 499 } | 501 } |
| 500 | 502 |
| 501 /** | 503 /** |
| 502 * A class of exception that is not used anywhere else. | 504 * A class of exception that is not used anywhere else. |
| 503 */ | 505 */ |
| 504 class _CycleException implements Exception {} | 506 class _CycleException implements Exception {} |
| OLD | NEW |