| 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.dart.element.element; | 5 library analyzer.src.dart.element.element; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 visitedClasses = <ClassElementImpl>[this]; | 672 visitedClasses = <ClassElementImpl>[this]; |
| 673 } else { | 673 } else { |
| 674 if (visitedClasses.contains(this)) { | 674 if (visitedClasses.contains(this)) { |
| 675 // Loop in the class hierarchy. Don't try to forward any | 675 // Loop in the class hierarchy. Don't try to forward any |
| 676 // constructors. | 676 // constructors. |
| 677 return <ConstructorElement>[]; | 677 return <ConstructorElement>[]; |
| 678 } | 678 } |
| 679 visitedClasses.add(this); | 679 visitedClasses.add(this); |
| 680 } | 680 } |
| 681 try { | 681 try { |
| 682 ClassElementImpl superclass = supertype.element; | 682 ClassElement superclass = supertype.element; |
| 683 constructorsToForward = | 683 if (superclass is ClassElementHandle) { |
| 684 superclass._computeMixinAppConstructors(visitedClasses); | 684 superclass = (superclass as ClassElementHandle).actualElement; |
| 685 } |
| 686 constructorsToForward = (superclass as ClassElementImpl) |
| 687 ._computeMixinAppConstructors(visitedClasses); |
| 685 } finally { | 688 } finally { |
| 686 visitedClasses.removeLast(); | 689 visitedClasses.removeLast(); |
| 687 } | 690 } |
| 688 } | 691 } |
| 689 | 692 |
| 690 // Figure out the type parameter substitution we need to perform in order | 693 // Figure out the type parameter substitution we need to perform in order |
| 691 // to produce constructors for this class. We want to be robust in the | 694 // to produce constructors for this class. We want to be robust in the |
| 692 // face of errors, so drop any extra type arguments and fill in any missing | 695 // face of errors, so drop any extra type arguments and fill in any missing |
| 693 // ones with `dynamic`. | 696 // ones with `dynamic`. |
| 694 List<DartType> parameterTypes = | 697 List<DartType> parameterTypes = |
| (...skipping 4232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4927 | 4930 |
| 4928 @override | 4931 @override |
| 4929 void visitElement(Element element) { | 4932 void visitElement(Element element) { |
| 4930 int offset = element.nameOffset; | 4933 int offset = element.nameOffset; |
| 4931 if (offset != -1) { | 4934 if (offset != -1) { |
| 4932 map[offset] = element; | 4935 map[offset] = element; |
| 4933 } | 4936 } |
| 4934 super.visitElement(element); | 4937 super.visitElement(element); |
| 4935 } | 4938 } |
| 4936 } | 4939 } |
| OLD | NEW |