OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library rasta.kernel; | 5 library rasta.kernel; |
6 | 6 |
7 import 'dart:async' show | 7 import 'dart:async' show |
8 Future; | 8 Future; |
9 | 9 |
10 import 'dart:collection' show | 10 import 'dart:collection' show |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 } | 567 } |
568 if (irLibrary != null) { | 568 if (irLibrary != null) { |
569 result.add(irLibrary); | 569 result.add(irLibrary); |
570 } | 570 } |
571 } | 571 } |
572 return result; | 572 return result; |
573 } | 573 } |
574 | 574 |
575 /// Returns true if [element] is synthesized to recover or represent a | 575 /// Returns true if [element] is synthesized to recover or represent a |
576 /// semantic error, for example, missing, duplicated, or ambiguous elements. | 576 /// semantic error, for example, missing, duplicated, or ambiguous elements. |
577 /// However, returns true for elements that have an unrecoverable syntax | 577 /// However, returns false for elements that have an unrecoverable syntax |
578 /// error. Both kinds of element will return true from [Element.isMalformed], | 578 /// error. Both kinds of element will return true from [Element.isMalformed], |
579 /// but they must be handled differently. For example, a static call to | 579 /// but they must be handled differently. For example, a static call to |
580 /// synthetic error element should be compiled to [ir.InvalidExpression], | 580 /// synthetic error element should be compiled to [ir.InvalidExpression], |
581 /// whereas a static call to a method which has a syntax error should be | 581 /// whereas a static call to a method which has a syntax error should be |
582 /// compiled to a static call to the method. The method itself will have a | 582 /// compiled to a static call to the method. The method itself will have a |
583 /// method body that is [ir.InvalidStatement]. | 583 /// method body that is [ir.InvalidStatement]. |
584 bool isSyntheticError(Element element) { | 584 bool isSyntheticError(Element element) { |
585 if (element.isAmbiguous) return true; | 585 if (element.isAmbiguous) return true; |
586 if (element.isError) return true; | 586 if (element.isError) return true; |
587 if (element.isField && element is ErroneousFieldElementX) { | 587 if (element.isField && element is ErroneousFieldElementX) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 } | 665 } |
666 | 666 |
667 class ConstructorTarget { | 667 class ConstructorTarget { |
668 final ConstructorElement element; | 668 final ConstructorElement element; |
669 final DartType type; | 669 final DartType type; |
670 | 670 |
671 ConstructorTarget(this.element, this.type); | 671 ConstructorTarget(this.element, this.type); |
672 | 672 |
673 String toString() => "ConstructorTarget($element, $type)"; | 673 String toString() => "ConstructorTarget($element, $type)"; |
674 } | 674 } |
OLD | NEW |