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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.test.generated.inheritance_manager_test; | 5 library analyzer.test.generated.inheritance_manager_test; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
11 import 'package:analyzer/error/error.dart'; | 11 import 'package:analyzer/error/error.dart'; |
12 import 'package:analyzer/file_system/memory_file_system.dart'; | 12 import 'package:analyzer/file_system/memory_file_system.dart'; |
13 import 'package:analyzer/src/dart/element/element.dart'; | 13 import 'package:analyzer/src/dart/element/element.dart'; |
14 import 'package:analyzer/src/dart/resolver/inheritance_manager.dart'; | 14 import 'package:analyzer/src/dart/resolver/inheritance_manager.dart'; |
15 import 'package:analyzer/src/error/codes.dart'; | 15 import 'package:analyzer/src/error/codes.dart'; |
16 import 'package:analyzer/src/generated/engine.dart'; | 16 import 'package:analyzer/src/generated/engine.dart'; |
17 import 'package:analyzer/src/generated/resolver.dart'; | 17 import 'package:analyzer/src/generated/resolver.dart'; |
18 import 'package:analyzer/src/generated/source_io.dart'; | 18 import 'package:analyzer/src/generated/source_io.dart'; |
19 import 'package:analyzer/src/generated/testing/ast_factory.dart'; | 19 import 'package:analyzer/src/generated/testing/ast_test_factory.dart'; |
20 import 'package:analyzer/src/generated/testing/element_factory.dart'; | 20 import 'package:analyzer/src/generated/testing/element_factory.dart'; |
21 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; | 21 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; |
22 import 'package:analyzer/src/generated/utilities_dart.dart'; | 22 import 'package:analyzer/src/generated/utilities_dart.dart'; |
23 import 'package:analyzer/src/source/source_resource.dart'; | 23 import 'package:analyzer/src/source/source_resource.dart'; |
24 import 'package:test/test.dart'; | 24 import 'package:test/test.dart'; |
25 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 25 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
26 | 26 |
27 import 'analysis_context_factory.dart'; | 27 import 'analysis_context_factory.dart'; |
28 import 'test_support.dart'; | 28 import 'test_support.dart'; |
29 | 29 |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 void | 392 void |
393 test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_
numOfRequiredParams() { | 393 test_getMapOfMembersInheritedFromInterfaces_inconsistentMethodInheritance_
numOfRequiredParams() { |
394 // class I1 { dynamic m(int, [int]); } | 394 // class I1 { dynamic m(int, [int]); } |
395 // class I2 { dynamic m(int, int, int); } | 395 // class I2 { dynamic m(int, int, int); } |
396 // class A implements I1, I2 {} | 396 // class A implements I1, I2 {} |
397 ClassElementImpl classI1 = ElementFactory.classElement2("I1"); | 397 ClassElementImpl classI1 = ElementFactory.classElement2("I1"); |
398 String methodName = "m"; | 398 String methodName = "m"; |
399 MethodElementImpl methodM1 = | 399 MethodElementImpl methodM1 = |
400 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); | 400 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); |
401 ParameterElementImpl parameter1 = | 401 ParameterElementImpl parameter1 = |
402 new ParameterElementImpl.forNode(AstFactory.identifier3("a1")); | 402 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a1")); |
403 parameter1.type = _typeProvider.intType; | 403 parameter1.type = _typeProvider.intType; |
404 parameter1.parameterKind = ParameterKind.REQUIRED; | 404 parameter1.parameterKind = ParameterKind.REQUIRED; |
405 ParameterElementImpl parameter2 = | 405 ParameterElementImpl parameter2 = |
406 new ParameterElementImpl.forNode(AstFactory.identifier3("a2")); | 406 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a2")); |
407 parameter2.type = _typeProvider.intType; | 407 parameter2.type = _typeProvider.intType; |
408 parameter2.parameterKind = ParameterKind.POSITIONAL; | 408 parameter2.parameterKind = ParameterKind.POSITIONAL; |
409 methodM1.parameters = <ParameterElement>[parameter1, parameter2]; | 409 methodM1.parameters = <ParameterElement>[parameter1, parameter2]; |
410 classI1.methods = <MethodElement>[methodM1]; | 410 classI1.methods = <MethodElement>[methodM1]; |
411 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); | 411 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); |
412 MethodElementImpl methodM2 = | 412 MethodElementImpl methodM2 = |
413 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); | 413 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); |
414 ParameterElementImpl parameter3 = | 414 ParameterElementImpl parameter3 = |
415 new ParameterElementImpl.forNode(AstFactory.identifier3("a3")); | 415 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a3")); |
416 parameter3.type = _typeProvider.intType; | 416 parameter3.type = _typeProvider.intType; |
417 parameter3.parameterKind = ParameterKind.REQUIRED; | 417 parameter3.parameterKind = ParameterKind.REQUIRED; |
418 ParameterElementImpl parameter4 = | 418 ParameterElementImpl parameter4 = |
419 new ParameterElementImpl.forNode(AstFactory.identifier3("a4")); | 419 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a4")); |
420 parameter4.type = _typeProvider.intType; | 420 parameter4.type = _typeProvider.intType; |
421 parameter4.parameterKind = ParameterKind.REQUIRED; | 421 parameter4.parameterKind = ParameterKind.REQUIRED; |
422 ParameterElementImpl parameter5 = | 422 ParameterElementImpl parameter5 = |
423 new ParameterElementImpl.forNode(AstFactory.identifier3("a5")); | 423 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a5")); |
424 parameter5.type = _typeProvider.intType; | 424 parameter5.type = _typeProvider.intType; |
425 parameter5.parameterKind = ParameterKind.REQUIRED; | 425 parameter5.parameterKind = ParameterKind.REQUIRED; |
426 methodM2.parameters = <ParameterElement>[ | 426 methodM2.parameters = <ParameterElement>[ |
427 parameter3, | 427 parameter3, |
428 parameter4, | 428 parameter4, |
429 parameter5 | 429 parameter5 |
430 ]; | 430 ]; |
431 classI2.methods = <MethodElement>[methodM2]; | 431 classI2.methods = <MethodElement>[methodM2]; |
432 ClassElementImpl classA = ElementFactory.classElement2("A"); | 432 ClassElementImpl classA = ElementFactory.classElement2("A"); |
433 classA.interfaces = <InterfaceType>[classI1.type, classI2.type]; | 433 classA.interfaces = <InterfaceType>[classI1.type, classI2.type]; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 void | 577 void |
578 test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_metho
ds() { | 578 test_getMapOfMembersInheritedFromInterfaces_union_multipleSubtypes_2_metho
ds() { |
579 // class I1 { dynamic m(int); } | 579 // class I1 { dynamic m(int); } |
580 // class I2 { dynamic m(num); } | 580 // class I2 { dynamic m(num); } |
581 // class A implements I1, I2 {} | 581 // class A implements I1, I2 {} |
582 ClassElementImpl classI1 = ElementFactory.classElement2("I1"); | 582 ClassElementImpl classI1 = ElementFactory.classElement2("I1"); |
583 String methodName = "m"; | 583 String methodName = "m"; |
584 MethodElementImpl methodM1 = | 584 MethodElementImpl methodM1 = |
585 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); | 585 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); |
586 ParameterElementImpl parameter1 = | 586 ParameterElementImpl parameter1 = |
587 new ParameterElementImpl.forNode(AstFactory.identifier3("a0")); | 587 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a0")); |
588 parameter1.type = _typeProvider.intType; | 588 parameter1.type = _typeProvider.intType; |
589 parameter1.parameterKind = ParameterKind.REQUIRED; | 589 parameter1.parameterKind = ParameterKind.REQUIRED; |
590 methodM1.parameters = <ParameterElement>[parameter1]; | 590 methodM1.parameters = <ParameterElement>[parameter1]; |
591 classI1.methods = <MethodElement>[methodM1]; | 591 classI1.methods = <MethodElement>[methodM1]; |
592 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); | 592 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); |
593 MethodElementImpl methodM2 = | 593 MethodElementImpl methodM2 = |
594 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); | 594 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); |
595 ParameterElementImpl parameter2 = | 595 ParameterElementImpl parameter2 = |
596 new ParameterElementImpl.forNode(AstFactory.identifier3("a0")); | 596 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a0")); |
597 parameter2.type = _typeProvider.numType; | 597 parameter2.type = _typeProvider.numType; |
598 parameter2.parameterKind = ParameterKind.REQUIRED; | 598 parameter2.parameterKind = ParameterKind.REQUIRED; |
599 methodM2.parameters = <ParameterElement>[parameter2]; | 599 methodM2.parameters = <ParameterElement>[parameter2]; |
600 classI2.methods = <MethodElement>[methodM2]; | 600 classI2.methods = <MethodElement>[methodM2]; |
601 ClassElementImpl classA = ElementFactory.classElement2("A"); | 601 ClassElementImpl classA = ElementFactory.classElement2("A"); |
602 classA.interfaces = <InterfaceType>[classI1.type, classI2.type]; | 602 classA.interfaces = <InterfaceType>[classI1.type, classI2.type]; |
603 Map<String, ExecutableElement> mapA = | 603 Map<String, ExecutableElement> mapA = |
604 _inheritanceManager.getMembersInheritedFromInterfaces(classA); | 604 _inheritanceManager.getMembersInheritedFromInterfaces(classA); |
605 expect(mapA.length, _numOfMembersInObject + 1); | 605 expect(mapA.length, _numOfMembersInObject + 1); |
606 MethodElement syntheticMethod = ElementFactory.methodElement( | 606 MethodElement syntheticMethod = ElementFactory.methodElement( |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 // class I3 { dynamic m(C c); } | 685 // class I3 { dynamic m(C c); } |
686 // class D implements I1, I2, I3 {} | 686 // class D implements I1, I2, I3 {} |
687 ClassElementImpl classA = ElementFactory.classElement2("A"); | 687 ClassElementImpl classA = ElementFactory.classElement2("A"); |
688 ClassElementImpl classB = ElementFactory.classElement("B", classA.type); | 688 ClassElementImpl classB = ElementFactory.classElement("B", classA.type); |
689 ClassElementImpl classC = ElementFactory.classElement("C", classB.type); | 689 ClassElementImpl classC = ElementFactory.classElement("C", classB.type); |
690 ClassElementImpl classI1 = ElementFactory.classElement2("I1"); | 690 ClassElementImpl classI1 = ElementFactory.classElement2("I1"); |
691 String methodName = "m"; | 691 String methodName = "m"; |
692 MethodElementImpl methodM1 = | 692 MethodElementImpl methodM1 = |
693 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); | 693 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); |
694 ParameterElementImpl parameter1 = | 694 ParameterElementImpl parameter1 = |
695 new ParameterElementImpl.forNode(AstFactory.identifier3("a0")); | 695 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a0")); |
696 parameter1.type = classA.type; | 696 parameter1.type = classA.type; |
697 parameter1.parameterKind = ParameterKind.REQUIRED; | 697 parameter1.parameterKind = ParameterKind.REQUIRED; |
698 methodM1.parameters = <ParameterElement>[parameter1]; | 698 methodM1.parameters = <ParameterElement>[parameter1]; |
699 classI1.methods = <MethodElement>[methodM1]; | 699 classI1.methods = <MethodElement>[methodM1]; |
700 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); | 700 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); |
701 MethodElementImpl methodM2 = | 701 MethodElementImpl methodM2 = |
702 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); | 702 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); |
703 ParameterElementImpl parameter2 = | 703 ParameterElementImpl parameter2 = |
704 new ParameterElementImpl.forNode(AstFactory.identifier3("a0")); | 704 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a0")); |
705 parameter2.type = classB.type; | 705 parameter2.type = classB.type; |
706 parameter2.parameterKind = ParameterKind.REQUIRED; | 706 parameter2.parameterKind = ParameterKind.REQUIRED; |
707 methodM2.parameters = <ParameterElement>[parameter2]; | 707 methodM2.parameters = <ParameterElement>[parameter2]; |
708 classI2.methods = <MethodElement>[methodM2]; | 708 classI2.methods = <MethodElement>[methodM2]; |
709 ClassElementImpl classI3 = ElementFactory.classElement2("I3"); | 709 ClassElementImpl classI3 = ElementFactory.classElement2("I3"); |
710 MethodElementImpl methodM3 = | 710 MethodElementImpl methodM3 = |
711 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); | 711 ElementFactory.methodElement(methodName, _typeProvider.dynamicType); |
712 ParameterElementImpl parameter3 = | 712 ParameterElementImpl parameter3 = |
713 new ParameterElementImpl.forNode(AstFactory.identifier3("a0")); | 713 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a0")); |
714 parameter3.type = classC.type; | 714 parameter3.type = classC.type; |
715 parameter3.parameterKind = ParameterKind.REQUIRED; | 715 parameter3.parameterKind = ParameterKind.REQUIRED; |
716 methodM3.parameters = <ParameterElement>[parameter3]; | 716 methodM3.parameters = <ParameterElement>[parameter3]; |
717 classI3.methods = <MethodElement>[methodM3]; | 717 classI3.methods = <MethodElement>[methodM3]; |
718 ClassElementImpl classD = ElementFactory.classElement2("D"); | 718 ClassElementImpl classD = ElementFactory.classElement2("D"); |
719 classD.interfaces = <InterfaceType>[ | 719 classD.interfaces = <InterfaceType>[ |
720 classI1.type, | 720 classI1.type, |
721 classI2.type, | 721 classI2.type, |
722 classI3.type | 722 classI3.type |
723 ]; | 723 ]; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 // class A implements I1, I2 {} | 778 // class A implements I1, I2 {} |
779 ClassElementImpl classI1 = ElementFactory.classElement2("I1"); | 779 ClassElementImpl classI1 = ElementFactory.classElement2("I1"); |
780 String methodName = "m"; | 780 String methodName = "m"; |
781 MethodElement methodM1 = | 781 MethodElement methodM1 = |
782 ElementFactory.methodElement(methodName, _typeProvider.intType); | 782 ElementFactory.methodElement(methodName, _typeProvider.intType); |
783 classI1.methods = <MethodElement>[methodM1]; | 783 classI1.methods = <MethodElement>[methodM1]; |
784 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); | 784 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); |
785 MethodElementImpl methodM2 = | 785 MethodElementImpl methodM2 = |
786 ElementFactory.methodElement(methodName, _typeProvider.intType); | 786 ElementFactory.methodElement(methodName, _typeProvider.intType); |
787 ParameterElementImpl parameter1 = | 787 ParameterElementImpl parameter1 = |
788 new ParameterElementImpl.forNode(AstFactory.identifier3("a1")); | 788 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a1")); |
789 parameter1.type = _typeProvider.intType; | 789 parameter1.type = _typeProvider.intType; |
790 parameter1.parameterKind = ParameterKind.POSITIONAL; | 790 parameter1.parameterKind = ParameterKind.POSITIONAL; |
791 methodM2.parameters = <ParameterElement>[parameter1]; | 791 methodM2.parameters = <ParameterElement>[parameter1]; |
792 classI2.methods = <MethodElement>[methodM2]; | 792 classI2.methods = <MethodElement>[methodM2]; |
793 ClassElementImpl classA = ElementFactory.classElement2("A"); | 793 ClassElementImpl classA = ElementFactory.classElement2("A"); |
794 classA.interfaces = <InterfaceType>[classI1.type, classI2.type]; | 794 classA.interfaces = <InterfaceType>[classI1.type, classI2.type]; |
795 Map<String, ExecutableElement> mapA = | 795 Map<String, ExecutableElement> mapA = |
796 _inheritanceManager.getMembersInheritedFromInterfaces(classA); | 796 _inheritanceManager.getMembersInheritedFromInterfaces(classA); |
797 expect(mapA.length, _numOfMembersInObject + 1); | 797 expect(mapA.length, _numOfMembersInObject + 1); |
798 expect(mapA[methodName], same(methodM2)); | 798 expect(mapA[methodName], same(methodM2)); |
799 _assertNoErrors(classA); | 799 _assertNoErrors(classA); |
800 } | 800 } |
801 | 801 |
802 void | 802 void |
803 test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_3_methods() { | 803 test_getMapOfMembersInheritedFromInterfaces_union_oneSubtype_3_methods() { |
804 // class I1 { int m(); } | 804 // class I1 { int m(); } |
805 // class I2 { int m([int]); } | 805 // class I2 { int m([int]); } |
806 // class I3 { int m([int, int]); } | 806 // class I3 { int m([int, int]); } |
807 // class A implements I1, I2, I3 {} | 807 // class A implements I1, I2, I3 {} |
808 ClassElementImpl classI1 = ElementFactory.classElement2("I1"); | 808 ClassElementImpl classI1 = ElementFactory.classElement2("I1"); |
809 String methodName = "m"; | 809 String methodName = "m"; |
810 MethodElementImpl methodM1 = | 810 MethodElementImpl methodM1 = |
811 ElementFactory.methodElement(methodName, _typeProvider.intType); | 811 ElementFactory.methodElement(methodName, _typeProvider.intType); |
812 classI1.methods = <MethodElement>[methodM1]; | 812 classI1.methods = <MethodElement>[methodM1]; |
813 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); | 813 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); |
814 MethodElementImpl methodM2 = | 814 MethodElementImpl methodM2 = |
815 ElementFactory.methodElement(methodName, _typeProvider.intType); | 815 ElementFactory.methodElement(methodName, _typeProvider.intType); |
816 ParameterElementImpl parameter1 = | 816 ParameterElementImpl parameter1 = |
817 new ParameterElementImpl.forNode(AstFactory.identifier3("a1")); | 817 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a1")); |
818 parameter1.type = _typeProvider.intType; | 818 parameter1.type = _typeProvider.intType; |
819 parameter1.parameterKind = ParameterKind.POSITIONAL; | 819 parameter1.parameterKind = ParameterKind.POSITIONAL; |
820 methodM1.parameters = <ParameterElement>[parameter1]; | 820 methodM1.parameters = <ParameterElement>[parameter1]; |
821 classI2.methods = <MethodElement>[methodM2]; | 821 classI2.methods = <MethodElement>[methodM2]; |
822 ClassElementImpl classI3 = ElementFactory.classElement2("I3"); | 822 ClassElementImpl classI3 = ElementFactory.classElement2("I3"); |
823 MethodElementImpl methodM3 = | 823 MethodElementImpl methodM3 = |
824 ElementFactory.methodElement(methodName, _typeProvider.intType); | 824 ElementFactory.methodElement(methodName, _typeProvider.intType); |
825 ParameterElementImpl parameter2 = | 825 ParameterElementImpl parameter2 = |
826 new ParameterElementImpl.forNode(AstFactory.identifier3("a2")); | 826 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a2")); |
827 parameter2.type = _typeProvider.intType; | 827 parameter2.type = _typeProvider.intType; |
828 parameter2.parameterKind = ParameterKind.POSITIONAL; | 828 parameter2.parameterKind = ParameterKind.POSITIONAL; |
829 ParameterElementImpl parameter3 = | 829 ParameterElementImpl parameter3 = |
830 new ParameterElementImpl.forNode(AstFactory.identifier3("a3")); | 830 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a3")); |
831 parameter3.type = _typeProvider.intType; | 831 parameter3.type = _typeProvider.intType; |
832 parameter3.parameterKind = ParameterKind.POSITIONAL; | 832 parameter3.parameterKind = ParameterKind.POSITIONAL; |
833 methodM3.parameters = <ParameterElement>[parameter2, parameter3]; | 833 methodM3.parameters = <ParameterElement>[parameter2, parameter3]; |
834 classI3.methods = <MethodElement>[methodM3]; | 834 classI3.methods = <MethodElement>[methodM3]; |
835 ClassElementImpl classA = ElementFactory.classElement2("A"); | 835 ClassElementImpl classA = ElementFactory.classElement2("A"); |
836 classA.interfaces = <InterfaceType>[ | 836 classA.interfaces = <InterfaceType>[ |
837 classI1.type, | 837 classI1.type, |
838 classI2.type, | 838 classI2.type, |
839 classI3.type | 839 classI3.type |
840 ]; | 840 ]; |
(...skipping 17 matching lines...) Expand all Loading... |
858 ElementFactory.methodElement(methodName, _typeProvider.intType); | 858 ElementFactory.methodElement(methodName, _typeProvider.intType); |
859 classI1.methods = <MethodElement>[methodM1]; | 859 classI1.methods = <MethodElement>[methodM1]; |
860 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); | 860 ClassElementImpl classI2 = ElementFactory.classElement2("I2"); |
861 MethodElement methodM2 = | 861 MethodElement methodM2 = |
862 ElementFactory.methodElement(methodName, _typeProvider.intType); | 862 ElementFactory.methodElement(methodName, _typeProvider.intType); |
863 classI2.methods = <MethodElement>[methodM2]; | 863 classI2.methods = <MethodElement>[methodM2]; |
864 ClassElementImpl classI3 = ElementFactory.classElement2("I3"); | 864 ClassElementImpl classI3 = ElementFactory.classElement2("I3"); |
865 MethodElementImpl methodM3 = | 865 MethodElementImpl methodM3 = |
866 ElementFactory.methodElement(methodName, _typeProvider.intType); | 866 ElementFactory.methodElement(methodName, _typeProvider.intType); |
867 ParameterElementImpl parameter1 = | 867 ParameterElementImpl parameter1 = |
868 new ParameterElementImpl.forNode(AstFactory.identifier3("a1")); | 868 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a1")); |
869 parameter1.type = _typeProvider.intType; | 869 parameter1.type = _typeProvider.intType; |
870 parameter1.parameterKind = ParameterKind.POSITIONAL; | 870 parameter1.parameterKind = ParameterKind.POSITIONAL; |
871 methodM3.parameters = <ParameterElement>[parameter1]; | 871 methodM3.parameters = <ParameterElement>[parameter1]; |
872 classI3.methods = <MethodElement>[methodM3]; | 872 classI3.methods = <MethodElement>[methodM3]; |
873 ClassElementImpl classI4 = ElementFactory.classElement2("I4"); | 873 ClassElementImpl classI4 = ElementFactory.classElement2("I4"); |
874 MethodElementImpl methodM4 = | 874 MethodElementImpl methodM4 = |
875 ElementFactory.methodElement(methodName, _typeProvider.intType); | 875 ElementFactory.methodElement(methodName, _typeProvider.intType); |
876 ParameterElementImpl parameter2 = | 876 ParameterElementImpl parameter2 = |
877 new ParameterElementImpl.forNode(AstFactory.identifier3("a2")); | 877 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a2")); |
878 parameter2.type = _typeProvider.intType; | 878 parameter2.type = _typeProvider.intType; |
879 parameter2.parameterKind = ParameterKind.POSITIONAL; | 879 parameter2.parameterKind = ParameterKind.POSITIONAL; |
880 ParameterElementImpl parameter3 = | 880 ParameterElementImpl parameter3 = |
881 new ParameterElementImpl.forNode(AstFactory.identifier3("a3")); | 881 new ParameterElementImpl.forNode(AstTestFactory.identifier3("a3")); |
882 parameter3.type = _typeProvider.intType; | 882 parameter3.type = _typeProvider.intType; |
883 parameter3.parameterKind = ParameterKind.POSITIONAL; | 883 parameter3.parameterKind = ParameterKind.POSITIONAL; |
884 methodM4.parameters = <ParameterElement>[parameter2, parameter3]; | 884 methodM4.parameters = <ParameterElement>[parameter2, parameter3]; |
885 classI4.methods = <MethodElement>[methodM4]; | 885 classI4.methods = <MethodElement>[methodM4]; |
886 ClassElementImpl classA = ElementFactory.classElement2("A"); | 886 ClassElementImpl classA = ElementFactory.classElement2("A"); |
887 classA.interfaces = <InterfaceType>[ | 887 classA.interfaces = <InterfaceType>[ |
888 classI1.type, | 888 classI1.type, |
889 classI2.type, | 889 classI2.type, |
890 classI3.type, | 890 classI3.type, |
891 classI4.type | 891 classI4.type |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 Source source = new FileSource(resourceProvider.getFile("/test.dart")); | 1314 Source source = new FileSource(resourceProvider.getFile("/test.dart")); |
1315 CompilationUnitElementImpl definingCompilationUnit = | 1315 CompilationUnitElementImpl definingCompilationUnit = |
1316 new CompilationUnitElementImpl("test.dart"); | 1316 new CompilationUnitElementImpl("test.dart"); |
1317 definingCompilationUnit.librarySource = | 1317 definingCompilationUnit.librarySource = |
1318 definingCompilationUnit.source = source; | 1318 definingCompilationUnit.source = source; |
1319 _definingLibrary = ElementFactory.library(context, "test"); | 1319 _definingLibrary = ElementFactory.library(context, "test"); |
1320 _definingLibrary.definingCompilationUnit = definingCompilationUnit; | 1320 _definingLibrary.definingCompilationUnit = definingCompilationUnit; |
1321 return new InheritanceManager(_definingLibrary); | 1321 return new InheritanceManager(_definingLibrary); |
1322 } | 1322 } |
1323 } | 1323 } |
OLD | NEW |