Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 1815253002: Fix another unguarded cast to an impl class (issue 26034, case 2) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/element/element_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/element/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698