| 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 engine.resolver; | 5 library engine.resolver; |
| 6 | 6 |
| 7 import "dart:math" as math; | 7 import "dart:math" as math; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/utilities_collection.dart'; | 10 import 'package:analyzer/src/generated/utilities_collection.dart'; |
| (...skipping 13409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13420 InterfaceType get futureType; | 13420 InterfaceType get futureType; |
| 13421 | 13421 |
| 13422 /** | 13422 /** |
| 13423 * Return the type representing the built-in type 'int'. | 13423 * Return the type representing the built-in type 'int'. |
| 13424 * | 13424 * |
| 13425 * @return the type representing the built-in type 'int' | 13425 * @return the type representing the built-in type 'int' |
| 13426 */ | 13426 */ |
| 13427 InterfaceType get intType; | 13427 InterfaceType get intType; |
| 13428 | 13428 |
| 13429 /** | 13429 /** |
| 13430 * Return the type representing the type 'Iterable<dynamic>'. |
| 13431 */ |
| 13432 InterfaceType get iterableDynamicType; |
| 13433 |
| 13434 /** |
| 13435 * Return the type representing the built-in type 'Iterable'. |
| 13436 */ |
| 13437 InterfaceType get iterableType; |
| 13438 |
| 13439 /** |
| 13430 * Return the type representing the built-in type 'List'. | 13440 * Return the type representing the built-in type 'List'. |
| 13431 * | 13441 * |
| 13432 * @return the type representing the built-in type 'List' | 13442 * @return the type representing the built-in type 'List' |
| 13433 */ | 13443 */ |
| 13434 InterfaceType get listType; | 13444 InterfaceType get listType; |
| 13435 | 13445 |
| 13436 /** | 13446 /** |
| 13437 * Return the type representing the built-in type 'Map'. | 13447 * Return the type representing the built-in type 'Map'. |
| 13438 * | 13448 * |
| 13439 * @return the type representing the built-in type 'Map' | 13449 * @return the type representing the built-in type 'Map' |
| (...skipping 22 matching lines...) Expand all Loading... |
| 13462 InterfaceType get objectType; | 13472 InterfaceType get objectType; |
| 13463 | 13473 |
| 13464 /** | 13474 /** |
| 13465 * Return the type representing the built-in type 'StackTrace'. | 13475 * Return the type representing the built-in type 'StackTrace'. |
| 13466 * | 13476 * |
| 13467 * @return the type representing the built-in type 'StackTrace' | 13477 * @return the type representing the built-in type 'StackTrace' |
| 13468 */ | 13478 */ |
| 13469 InterfaceType get stackTraceType; | 13479 InterfaceType get stackTraceType; |
| 13470 | 13480 |
| 13471 /** | 13481 /** |
| 13482 * Return the type representing 'Stream<dynamic>'. |
| 13483 */ |
| 13484 InterfaceType get streamDynamicType; |
| 13485 |
| 13486 /** |
| 13487 * Return the type representing the built-in type 'Stream'. |
| 13488 */ |
| 13489 InterfaceType get streamType; |
| 13490 |
| 13491 /** |
| 13472 * Return the type representing the built-in type 'String'. | 13492 * Return the type representing the built-in type 'String'. |
| 13473 * | 13493 * |
| 13474 * @return the type representing the built-in type 'String' | 13494 * @return the type representing the built-in type 'String' |
| 13475 */ | 13495 */ |
| 13476 InterfaceType get stringType; | 13496 InterfaceType get stringType; |
| 13477 | 13497 |
| 13478 /** | 13498 /** |
| 13479 * Return the type representing the built-in type 'Symbol'. | 13499 * Return the type representing the built-in type 'Symbol'. |
| 13480 * | 13500 * |
| 13481 * @return the type representing the built-in type 'Symbol' | 13501 * @return the type representing the built-in type 'Symbol' |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13539 * The type representing the built-in type 'Future'. | 13559 * The type representing the built-in type 'Future'. |
| 13540 */ | 13560 */ |
| 13541 InterfaceType _futureType; | 13561 InterfaceType _futureType; |
| 13542 | 13562 |
| 13543 /** | 13563 /** |
| 13544 * The type representing the built-in type 'int'. | 13564 * The type representing the built-in type 'int'. |
| 13545 */ | 13565 */ |
| 13546 InterfaceType _intType; | 13566 InterfaceType _intType; |
| 13547 | 13567 |
| 13548 /** | 13568 /** |
| 13569 * The type representing 'Iterable<dynamic>'. |
| 13570 */ |
| 13571 InterfaceType _iterableDynamicType; |
| 13572 |
| 13573 /** |
| 13574 * The type representing the built-in type 'Iterable'. |
| 13575 */ |
| 13576 InterfaceType _iterableType; |
| 13577 |
| 13578 /** |
| 13549 * The type representing the built-in type 'List'. | 13579 * The type representing the built-in type 'List'. |
| 13550 */ | 13580 */ |
| 13551 InterfaceType _listType; | 13581 InterfaceType _listType; |
| 13552 | 13582 |
| 13553 /** | 13583 /** |
| 13554 * The type representing the built-in type 'Map'. | 13584 * The type representing the built-in type 'Map'. |
| 13555 */ | 13585 */ |
| 13556 InterfaceType _mapType; | 13586 InterfaceType _mapType; |
| 13557 | 13587 |
| 13558 /** | 13588 /** |
| (...skipping 10 matching lines...) Expand all Loading... |
| 13569 * The type representing the built-in type 'Object'. | 13599 * The type representing the built-in type 'Object'. |
| 13570 */ | 13600 */ |
| 13571 InterfaceType _objectType; | 13601 InterfaceType _objectType; |
| 13572 | 13602 |
| 13573 /** | 13603 /** |
| 13574 * The type representing the built-in type 'StackTrace'. | 13604 * The type representing the built-in type 'StackTrace'. |
| 13575 */ | 13605 */ |
| 13576 InterfaceType _stackTraceType; | 13606 InterfaceType _stackTraceType; |
| 13577 | 13607 |
| 13578 /** | 13608 /** |
| 13609 * The type representing 'Stream<dynamic>'. |
| 13610 */ |
| 13611 InterfaceType _streamDynamicType; |
| 13612 |
| 13613 /** |
| 13614 * The type representing the built-in type 'Stream'. |
| 13615 */ |
| 13616 InterfaceType _streamType; |
| 13617 |
| 13618 /** |
| 13579 * The type representing the built-in type 'String'. | 13619 * The type representing the built-in type 'String'. |
| 13580 */ | 13620 */ |
| 13581 InterfaceType _stringType; | 13621 InterfaceType _stringType; |
| 13582 | 13622 |
| 13583 /** | 13623 /** |
| 13584 * The type representing the built-in type 'Symbol'. | 13624 * The type representing the built-in type 'Symbol'. |
| 13585 */ | 13625 */ |
| 13586 InterfaceType _symbolType; | 13626 InterfaceType _symbolType; |
| 13587 | 13627 |
| 13588 /** | 13628 /** |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13625 @override | 13665 @override |
| 13626 InterfaceType get futureNullType => _futureNullType; | 13666 InterfaceType get futureNullType => _futureNullType; |
| 13627 | 13667 |
| 13628 @override | 13668 @override |
| 13629 InterfaceType get futureType => _futureType; | 13669 InterfaceType get futureType => _futureType; |
| 13630 | 13670 |
| 13631 @override | 13671 @override |
| 13632 InterfaceType get intType => _intType; | 13672 InterfaceType get intType => _intType; |
| 13633 | 13673 |
| 13634 @override | 13674 @override |
| 13675 InterfaceType get iterableDynamicType => _iterableDynamicType; |
| 13676 |
| 13677 @override |
| 13678 InterfaceType get iterableType => _iterableType; |
| 13679 |
| 13680 @override |
| 13635 InterfaceType get listType => _listType; | 13681 InterfaceType get listType => _listType; |
| 13636 | 13682 |
| 13637 @override | 13683 @override |
| 13638 InterfaceType get mapType => _mapType; | 13684 InterfaceType get mapType => _mapType; |
| 13639 | 13685 |
| 13640 @override | 13686 @override |
| 13641 InterfaceType get nullType => _nullType; | 13687 InterfaceType get nullType => _nullType; |
| 13642 | 13688 |
| 13643 @override | 13689 @override |
| 13644 InterfaceType get numType => _numType; | 13690 InterfaceType get numType => _numType; |
| 13645 | 13691 |
| 13646 @override | 13692 @override |
| 13647 InterfaceType get objectType => _objectType; | 13693 InterfaceType get objectType => _objectType; |
| 13648 | 13694 |
| 13649 @override | 13695 @override |
| 13650 InterfaceType get stackTraceType => _stackTraceType; | 13696 InterfaceType get stackTraceType => _stackTraceType; |
| 13651 | 13697 |
| 13652 @override | 13698 @override |
| 13699 InterfaceType get streamDynamicType => _streamDynamicType; |
| 13700 |
| 13701 @override |
| 13702 InterfaceType get streamType => _streamType; |
| 13703 |
| 13704 @override |
| 13653 InterfaceType get stringType => _stringType; | 13705 InterfaceType get stringType => _stringType; |
| 13654 | 13706 |
| 13655 @override | 13707 @override |
| 13656 InterfaceType get symbolType => _symbolType; | 13708 InterfaceType get symbolType => _symbolType; |
| 13657 | 13709 |
| 13658 @override | 13710 @override |
| 13659 InterfaceType get typeType => _typeType; | 13711 InterfaceType get typeType => _typeType; |
| 13660 | 13712 |
| 13661 @override | 13713 @override |
| 13662 DartType get undefinedType => _undefinedType; | 13714 DartType get undefinedType => _undefinedType; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 13691 Namespace asyncNamespace = | 13743 Namespace asyncNamespace = |
| 13692 new NamespaceBuilder().createPublicNamespaceForLibrary(asyncLibrary); | 13744 new NamespaceBuilder().createPublicNamespaceForLibrary(asyncLibrary); |
| 13693 _boolType = _getType(coreNamespace, "bool"); | 13745 _boolType = _getType(coreNamespace, "bool"); |
| 13694 _bottomType = BottomTypeImpl.instance; | 13746 _bottomType = BottomTypeImpl.instance; |
| 13695 _deprecatedType = _getType(coreNamespace, "Deprecated"); | 13747 _deprecatedType = _getType(coreNamespace, "Deprecated"); |
| 13696 _doubleType = _getType(coreNamespace, "double"); | 13748 _doubleType = _getType(coreNamespace, "double"); |
| 13697 _dynamicType = DynamicTypeImpl.instance; | 13749 _dynamicType = DynamicTypeImpl.instance; |
| 13698 _functionType = _getType(coreNamespace, "Function"); | 13750 _functionType = _getType(coreNamespace, "Function"); |
| 13699 _futureType = _getType(asyncNamespace, "Future"); | 13751 _futureType = _getType(asyncNamespace, "Future"); |
| 13700 _intType = _getType(coreNamespace, "int"); | 13752 _intType = _getType(coreNamespace, "int"); |
| 13753 _iterableType = _getType(coreNamespace, "Iterable"); |
| 13701 _listType = _getType(coreNamespace, "List"); | 13754 _listType = _getType(coreNamespace, "List"); |
| 13702 _mapType = _getType(coreNamespace, "Map"); | 13755 _mapType = _getType(coreNamespace, "Map"); |
| 13703 _nullType = _getType(coreNamespace, "Null"); | 13756 _nullType = _getType(coreNamespace, "Null"); |
| 13704 _numType = _getType(coreNamespace, "num"); | 13757 _numType = _getType(coreNamespace, "num"); |
| 13705 _objectType = _getType(coreNamespace, "Object"); | 13758 _objectType = _getType(coreNamespace, "Object"); |
| 13706 _stackTraceType = _getType(coreNamespace, "StackTrace"); | 13759 _stackTraceType = _getType(coreNamespace, "StackTrace"); |
| 13760 _streamType = _getType(asyncNamespace, "Stream"); |
| 13707 _stringType = _getType(coreNamespace, "String"); | 13761 _stringType = _getType(coreNamespace, "String"); |
| 13708 _symbolType = _getType(coreNamespace, "Symbol"); | 13762 _symbolType = _getType(coreNamespace, "Symbol"); |
| 13709 _typeType = _getType(coreNamespace, "Type"); | 13763 _typeType = _getType(coreNamespace, "Type"); |
| 13710 _undefinedType = UndefinedTypeImpl.instance; | 13764 _undefinedType = UndefinedTypeImpl.instance; |
| 13711 _futureNullType = _futureType.substitute4(<DartType>[_nullType]); | 13765 _futureNullType = _futureType.substitute4(<DartType>[_nullType]); |
| 13766 _iterableDynamicType = _iterableType.substitute4(<DartType>[_dynamicType]); |
| 13767 _streamDynamicType = _streamType.substitute4(<DartType>[_dynamicType]); |
| 13712 } | 13768 } |
| 13713 } | 13769 } |
| 13714 | 13770 |
| 13715 /** | 13771 /** |
| 13716 * Instances of the class `TypeResolverVisitor` are used to resolve the types as
sociated with | 13772 * Instances of the class `TypeResolverVisitor` are used to resolve the types as
sociated with |
| 13717 * the elements in the element model. This includes the types of superclasses, m
ixins, interfaces, | 13773 * the elements in the element model. This includes the types of superclasses, m
ixins, interfaces, |
| 13718 * fields, methods, parameters, and local variables. As a side-effect, this also
finishes building | 13774 * fields, methods, parameters, and local variables. As a side-effect, this also
finishes building |
| 13719 * the type hierarchy. | 13775 * the type hierarchy. |
| 13720 */ | 13776 */ |
| 13721 class TypeResolverVisitor extends ScopedVisitor { | 13777 class TypeResolverVisitor extends ScopedVisitor { |
| (...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15601 * library. | 15657 * library. |
| 15602 */ | 15658 */ |
| 15603 final HashSet<String> members = new HashSet<String>(); | 15659 final HashSet<String> members = new HashSet<String>(); |
| 15604 | 15660 |
| 15605 /** | 15661 /** |
| 15606 * Names of resolved or unresolved class members that are read in the | 15662 * Names of resolved or unresolved class members that are read in the |
| 15607 * library. | 15663 * library. |
| 15608 */ | 15664 */ |
| 15609 final HashSet<String> readMembers = new HashSet<String>(); | 15665 final HashSet<String> readMembers = new HashSet<String>(); |
| 15610 } | 15666 } |
| OLD | NEW |