| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 /** | 72 /** |
| 73 * The classes that have been visited while attempting to infer the types of | 73 * The classes that have been visited while attempting to infer the types of |
| 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(TypeProvider typeProvider, this.inheritanceManager, |
| 83 {TypeSystem typeSystem}) | 83 {TypeSystem typeSystem}) |
| 84 : typeSystem = (typeSystem != null) | 84 : typeSystem = (typeSystem != null) |
| 85 ? typeSystem | 85 ? typeSystem |
| 86 : new TypeSystemImpl(typeProvider); | 86 : new TypeSystemImpl(typeProvider), |
| 87 this.typeProvider = typeProvider; |
| 87 | 88 |
| 88 /** | 89 /** |
| 89 * Infer type information for all of the instance members in the given | 90 * Infer type information for all of the instance members in the given |
| 90 * compilation [unit]. | 91 * compilation [unit]. |
| 91 */ | 92 */ |
| 92 void inferCompilationUnit(CompilationUnitElement unit) { | 93 void inferCompilationUnit(CompilationUnitElement unit) { |
| 93 for (ClassElement classElement in unit.types) { | 94 for (ClassElement classElement in unit.types) { |
| 94 try { | 95 try { |
| 95 _inferClass(classElement); | 96 _inferClass(classElement); |
| 96 } on _CycleException { | 97 } on _CycleException { |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 results.add(element); | 498 results.add(element); |
| 498 } | 499 } |
| 499 } | 500 } |
| 500 } | 501 } |
| 501 } | 502 } |
| 502 | 503 |
| 503 /** | 504 /** |
| 504 * A class of exception that is not used anywhere else. | 505 * A class of exception that is not used anywhere else. |
| 505 */ | 506 */ |
| 506 class _CycleException implements Exception {} | 507 class _CycleException implements Exception {} |
| OLD | NEW |