Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.src.summary.summary_common; | 5 library analyzer.test.src.summary.summary_common; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 analysisContext.typeProvider.objectType.element.library, | 41 analysisContext.typeProvider.objectType.element.library, |
| 42 analysisContext.typeProvider.futureType.element.library | 42 analysisContext.typeProvider.futureType.element.library |
| 43 ]; | 43 ]; |
| 44 for (LibraryElement library in libraries) { | 44 for (LibraryElement library in libraries) { |
| 45 summarize_elements.LibrarySerializationResult serializedLibrary = | 45 summarize_elements.LibrarySerializationResult serializedLibrary = |
| 46 summarize_elements.serializeLibrary( | 46 summarize_elements.serializeLibrary( |
| 47 library, analysisContext.typeProvider); | 47 library, analysisContext.typeProvider); |
| 48 for (int i = 0; i < serializedLibrary.unlinkedUnits.length; i++) { | 48 for (int i = 0; i < serializedLibrary.unlinkedUnits.length; i++) { |
| 49 uriToNamespace[serializedLibrary.unitUris[i]] = | 49 uriToNamespace[serializedLibrary.unitUris[i]] = |
| 50 new UnlinkedUnit.fromBuffer( | 50 new UnlinkedUnit.fromBuffer( |
| 51 serializedLibrary.unlinkedUnits[i].toBuffer()).publicNamespace; | 51 serializedLibrary.unlinkedUnits[i].toBuffer()) |
| 52 .publicNamespace; | |
| 52 } | 53 } |
| 53 } | 54 } |
| 54 return uriToNamespace; | 55 return uriToNamespace; |
| 55 } catch (_) { | 56 } catch (_) { |
| 56 return null; | 57 return null; |
| 57 } | 58 } |
| 58 }(); | 59 }(); |
| 59 | 60 |
| 60 /** | 61 /** |
| 61 * Convert a summary object (or a portion of one) into a canonical form that | 62 * Convert a summary object (or a portion of one) into a canonical form that |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 754 | 755 |
| 755 /** | 756 /** |
| 756 * Serialize a type declaration using the given [text] as a type name, and | 757 * Serialize a type declaration using the given [text] as a type name, and |
| 757 * return a summary of the corresponding [EntityRef]. If the type | 758 * return a summary of the corresponding [EntityRef]. If the type |
| 758 * declaration needs to refer to types that are not available in core, those | 759 * declaration needs to refer to types that are not available in core, those |
| 759 * types may be declared in [otherDeclarations]. | 760 * types may be declared in [otherDeclarations]. |
| 760 */ | 761 */ |
| 761 EntityRef serializeTypeText(String text, | 762 EntityRef serializeTypeText(String text, |
| 762 {String otherDeclarations: '', bool allowErrors: false}) { | 763 {String otherDeclarations: '', bool allowErrors: false}) { |
| 763 return serializeVariableText('$otherDeclarations\n$text v;', | 764 return serializeVariableText('$otherDeclarations\n$text v;', |
| 764 allowErrors: allowErrors).type; | 765 allowErrors: allowErrors) |
| 766 .type; | |
| 765 } | 767 } |
| 766 | 768 |
| 767 /** | 769 /** |
| 768 * Serialize the given library [text] and return the summary of the variable | 770 * Serialize the given library [text] and return the summary of the variable |
| 769 * with the given [variableName]. | 771 * with the given [variableName]. |
| 770 */ | 772 */ |
| 771 UnlinkedVariable serializeVariableText(String text, | 773 UnlinkedVariable serializeVariableText(String text, |
| 772 {String variableName: 'v', bool allowErrors: false}) { | 774 {String variableName: 'v', bool allowErrors: false}) { |
| 773 serializeLibraryText(text, allowErrors: allowErrors); | 775 serializeLibraryText(text, allowErrors: allowErrors); |
| 774 return findVariable(variableName, failIfAbsent: true); | 776 return findVariable(variableName, failIfAbsent: true); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1039 checkDocumentationComment(cls.documentationComment, text); | 1041 checkDocumentationComment(cls.documentationComment, text); |
| 1040 } | 1042 } |
| 1041 | 1043 |
| 1042 test_class_documented_with_with_windows_line_endings() { | 1044 test_class_documented_with_with_windows_line_endings() { |
| 1043 String text = '/**\r\n * Docs\r\n */\r\nclass C {}'; | 1045 String text = '/**\r\n * Docs\r\n */\r\nclass C {}'; |
| 1044 UnlinkedClass cls = serializeClassText(text); | 1046 UnlinkedClass cls = serializeClassText(text); |
| 1045 expect(cls.documentationComment, isNotNull); | 1047 expect(cls.documentationComment, isNotNull); |
| 1046 checkDocumentationComment(cls.documentationComment, text); | 1048 checkDocumentationComment(cls.documentationComment, text); |
| 1047 } | 1049 } |
| 1048 | 1050 |
| 1051 test_class_executables() { | |
| 1052 UnlinkedClass cls = serializeClassText(''' | |
| 1053 class C { | |
| 1054 static void methodStaticPublic() {} | |
|
Paul Berry
2016/01/25 13:10:04
I'd recommend adding a line like this:
"C operato
scheglov
2016/01/25 17:27:09
Done.
| |
| 1055 static void _methodStaticPrivate() {} | |
| 1056 void methodInstancePublic() {} | |
| 1057 C(); | |
| 1058 C.constructorNamedPublic(); | |
| 1059 C._constructorNamedPrivate(); | |
| 1060 } | |
| 1061 '''); | |
| 1062 expect(cls.isAbstract, false); | |
| 1063 expect(unlinkedUnits[0].publicNamespace.names, hasLength(1)); | |
| 1064 UnlinkedPublicName className = unlinkedUnits[0].publicNamespace.names[0]; | |
| 1065 expect(className.kind, ReferenceKind.classOrEnum); | |
| 1066 expect(className.name, 'C'); | |
| 1067 expect(className.numTypeParameters, 0); | |
| 1068 // executables | |
| 1069 Map<String, UnlinkedPublicName> executablesMap = | |
| 1070 <String, UnlinkedPublicName>{}; | |
| 1071 className.executables.forEach((e) => executablesMap[e.name] = e); | |
| 1072 expect(executablesMap, hasLength(3)); | |
| 1073 { | |
| 1074 UnlinkedPublicName executable = executablesMap['methodStaticPublic']; | |
| 1075 expect(executable.kind, ReferenceKind.staticMethod); | |
| 1076 expect(executable.executables, isEmpty); | |
| 1077 } | |
| 1078 { | |
| 1079 UnlinkedPublicName executable = executablesMap['']; | |
| 1080 expect(executable.kind, ReferenceKind.constructor); | |
| 1081 expect(executable.executables, isEmpty); | |
| 1082 } | |
| 1083 { | |
| 1084 UnlinkedPublicName executable = executablesMap['constructorNamedPublic']; | |
| 1085 expect(executable.kind, ReferenceKind.constructor); | |
| 1086 expect(executable.executables, isEmpty); | |
| 1087 } | |
| 1088 } | |
| 1089 | |
| 1049 test_class_interface() { | 1090 test_class_interface() { |
| 1050 UnlinkedClass cls = serializeClassText(''' | 1091 UnlinkedClass cls = serializeClassText(''' |
| 1051 class C implements D {} | 1092 class C implements D {} |
| 1052 class D {} | 1093 class D {} |
| 1053 '''); | 1094 '''); |
| 1054 expect(cls.interfaces, hasLength(1)); | 1095 expect(cls.interfaces, hasLength(1)); |
| 1055 checkTypeRef(cls.interfaces[0], null, null, 'D'); | 1096 checkTypeRef(cls.interfaces[0], null, null, 'D'); |
| 1056 } | 1097 } |
| 1057 | 1098 |
| 1058 test_class_interface_order() { | 1099 test_class_interface_order() { |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1549 '' | 1590 '' |
| 1550 ], referenceValidators: [ | 1591 ], referenceValidators: [ |
| 1551 (EntityRef r) => checkTypeRef(r, null, null, 'C', | 1592 (EntityRef r) => checkTypeRef(r, null, null, 'C', |
| 1552 expectedKind: ReferenceKind.classOrEnum) | 1593 expectedKind: ReferenceKind.classOrEnum) |
| 1553 ]); | 1594 ]); |
| 1554 } | 1595 } |
| 1555 | 1596 |
| 1556 test_constExpr_length() { | 1597 test_constExpr_length() { |
| 1557 UnlinkedVariable variable = | 1598 UnlinkedVariable variable = |
| 1558 serializeVariableText('const v = "abc".length;'); | 1599 serializeVariableText('const v = "abc".length;'); |
| 1559 _assertUnlinkedConst(variable.constExpr, | 1600 _assertUnlinkedConst(variable.constExpr, operators: [ |
| 1560 operators: | 1601 UnlinkedConstOperation.pushString, |
| 1561 [UnlinkedConstOperation.pushString, UnlinkedConstOperation.length], | 1602 UnlinkedConstOperation.length |
| 1562 strings: ['abc']); | 1603 ], strings: [ |
| 1604 'abc' | |
| 1605 ]); | |
| 1563 } | 1606 } |
| 1564 | 1607 |
| 1565 test_constExpr_makeSymbol() { | 1608 test_constExpr_makeSymbol() { |
| 1566 UnlinkedVariable variable = serializeVariableText('const v = #a.bb.ccc;'); | 1609 UnlinkedVariable variable = serializeVariableText('const v = #a.bb.ccc;'); |
| 1567 _assertUnlinkedConst(variable.constExpr, operators: [ | 1610 _assertUnlinkedConst(variable.constExpr, operators: [ |
| 1568 UnlinkedConstOperation.pushString, | 1611 UnlinkedConstOperation.pushString, |
| 1569 UnlinkedConstOperation.makeSymbol | 1612 UnlinkedConstOperation.makeSymbol |
| 1570 ], strings: [ | 1613 ], strings: [ |
| 1571 'a.bb.ccc' | 1614 'a.bb.ccc' |
| 1572 ]); | 1615 ]); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1712 UnlinkedConstOperation.multiply, | 1755 UnlinkedConstOperation.multiply, |
| 1713 ], ints: [ | 1756 ], ints: [ |
| 1714 1, | 1757 1, |
| 1715 2, | 1758 2, |
| 1716 3 | 1759 3 |
| 1717 ]); | 1760 ]); |
| 1718 } | 1761 } |
| 1719 | 1762 |
| 1720 test_constExpr_prefix_complement() { | 1763 test_constExpr_prefix_complement() { |
| 1721 UnlinkedVariable variable = serializeVariableText('const v = ~2;'); | 1764 UnlinkedVariable variable = serializeVariableText('const v = ~2;'); |
| 1722 _assertUnlinkedConst(variable.constExpr, | 1765 _assertUnlinkedConst(variable.constExpr, operators: [ |
| 1723 operators: | 1766 UnlinkedConstOperation.pushInt, |
| 1724 [UnlinkedConstOperation.pushInt, UnlinkedConstOperation.complement], | 1767 UnlinkedConstOperation.complement |
| 1725 ints: [2]); | 1768 ], ints: [ |
| 1769 2 | |
| 1770 ]); | |
| 1726 } | 1771 } |
| 1727 | 1772 |
| 1728 test_constExpr_prefix_negate() { | 1773 test_constExpr_prefix_negate() { |
| 1729 UnlinkedVariable variable = serializeVariableText('const v = -(2);'); | 1774 UnlinkedVariable variable = serializeVariableText('const v = -(2);'); |
| 1730 _assertUnlinkedConst(variable.constExpr, | 1775 _assertUnlinkedConst(variable.constExpr, operators: [ |
| 1731 operators: | 1776 UnlinkedConstOperation.pushInt, |
| 1732 [UnlinkedConstOperation.pushInt, UnlinkedConstOperation.negate], | 1777 UnlinkedConstOperation.negate |
| 1733 ints: [2]); | 1778 ], ints: [ |
| 1779 2 | |
| 1780 ]); | |
| 1734 } | 1781 } |
| 1735 | 1782 |
| 1736 test_constExpr_prefix_not() { | 1783 test_constExpr_prefix_not() { |
| 1737 UnlinkedVariable variable = serializeVariableText('const v = !true;'); | 1784 UnlinkedVariable variable = serializeVariableText('const v = !true;'); |
| 1738 _assertUnlinkedConst(variable.constExpr, operators: | 1785 _assertUnlinkedConst(variable.constExpr, operators: [ |
| 1739 [UnlinkedConstOperation.pushTrue, UnlinkedConstOperation.not]); | 1786 UnlinkedConstOperation.pushTrue, |
| 1787 UnlinkedConstOperation.not | |
| 1788 ]); | |
| 1740 } | 1789 } |
| 1741 | 1790 |
| 1742 test_constExpr_pushDouble() { | 1791 test_constExpr_pushDouble() { |
| 1743 UnlinkedVariable variable = serializeVariableText('const v = 123.4567;'); | 1792 UnlinkedVariable variable = serializeVariableText('const v = 123.4567;'); |
| 1744 _assertUnlinkedConst(variable.constExpr, | 1793 _assertUnlinkedConst(variable.constExpr, |
| 1745 operators: [UnlinkedConstOperation.pushDouble], doubles: [123.4567]); | 1794 operators: [UnlinkedConstOperation.pushDouble], doubles: [123.4567]); |
| 1746 } | 1795 } |
| 1747 | 1796 |
| 1748 test_constExpr_pushFalse() { | 1797 test_constExpr_pushFalse() { |
| 1749 UnlinkedVariable variable = serializeVariableText('const v = false;'); | 1798 UnlinkedVariable variable = serializeVariableText('const v = false;'); |
| 1750 _assertUnlinkedConst(variable.constExpr, | 1799 _assertUnlinkedConst(variable.constExpr, |
| 1751 operators: [UnlinkedConstOperation.pushFalse]); | 1800 operators: [UnlinkedConstOperation.pushFalse]); |
| 1752 } | 1801 } |
| 1753 | 1802 |
| 1754 test_constExpr_pushInt() { | 1803 test_constExpr_pushInt() { |
| 1755 UnlinkedVariable variable = serializeVariableText('const v = 1;'); | 1804 UnlinkedVariable variable = serializeVariableText('const v = 1;'); |
| 1756 _assertUnlinkedConst(variable.constExpr, | 1805 _assertUnlinkedConst(variable.constExpr, |
| 1757 operators: [UnlinkedConstOperation.pushInt], ints: [1]); | 1806 operators: [UnlinkedConstOperation.pushInt], ints: [1]); |
| 1758 } | 1807 } |
| 1759 | 1808 |
| 1760 test_constExpr_pushInt_max() { | 1809 test_constExpr_pushInt_max() { |
| 1761 UnlinkedVariable variable = serializeVariableText('const v = 0xFFFFFFFF;'); | 1810 UnlinkedVariable variable = serializeVariableText('const v = 0xFFFFFFFF;'); |
| 1762 _assertUnlinkedConst(variable.constExpr, | 1811 _assertUnlinkedConst(variable.constExpr, |
| 1763 operators: [UnlinkedConstOperation.pushInt,], ints: [0xFFFFFFFF]); | 1812 operators: [UnlinkedConstOperation.pushInt,], ints: [0xFFFFFFFF]); |
| 1764 } | 1813 } |
| 1765 | 1814 |
| 1766 test_constExpr_pushInt_negative() { | 1815 test_constExpr_pushInt_negative() { |
| 1767 UnlinkedVariable variable = serializeVariableText('const v = -5;'); | 1816 UnlinkedVariable variable = serializeVariableText('const v = -5;'); |
| 1768 _assertUnlinkedConst(variable.constExpr, | 1817 _assertUnlinkedConst(variable.constExpr, operators: [ |
| 1769 operators: | 1818 UnlinkedConstOperation.pushInt, |
| 1770 [UnlinkedConstOperation.pushInt, UnlinkedConstOperation.negate], | 1819 UnlinkedConstOperation.negate |
| 1771 ints: [5]); | 1820 ], ints: [ |
| 1821 5 | |
| 1822 ]); | |
| 1772 } | 1823 } |
| 1773 | 1824 |
| 1774 test_constExpr_pushInt_shiftOr_long() { | 1825 test_constExpr_pushInt_shiftOr_long() { |
| 1775 UnlinkedVariable variable = | 1826 UnlinkedVariable variable = |
| 1776 serializeVariableText('const v = 0xA123456789ABCDEF012345678;'); | 1827 serializeVariableText('const v = 0xA123456789ABCDEF012345678;'); |
| 1777 _assertUnlinkedConst(variable.constExpr, operators: [ | 1828 _assertUnlinkedConst(variable.constExpr, operators: [ |
| 1778 UnlinkedConstOperation.pushInt, | 1829 UnlinkedConstOperation.pushInt, |
| 1779 UnlinkedConstOperation.shiftOr, | 1830 UnlinkedConstOperation.shiftOr, |
| 1780 UnlinkedConstOperation.shiftOr, | 1831 UnlinkedConstOperation.shiftOr, |
| 1781 UnlinkedConstOperation.shiftOr | 1832 UnlinkedConstOperation.shiftOr |
| 1782 ], ints: [ | 1833 ], ints: [ |
| 1783 0xA, | 1834 0xA, |
| 1784 0x12345678, | 1835 0x12345678, |
| 1785 0x9ABCDEF0, | 1836 0x9ABCDEF0, |
| 1786 0x12345678 | 1837 0x12345678 |
| 1787 ]); | 1838 ]); |
| 1788 } | 1839 } |
| 1789 | 1840 |
| 1790 test_constExpr_pushInt_shiftOr_min() { | 1841 test_constExpr_pushInt_shiftOr_min() { |
| 1791 UnlinkedVariable variable = serializeVariableText('const v = 0x100000000;'); | 1842 UnlinkedVariable variable = serializeVariableText('const v = 0x100000000;'); |
| 1792 _assertUnlinkedConst(variable.constExpr, | 1843 _assertUnlinkedConst(variable.constExpr, operators: [ |
| 1793 operators: | 1844 UnlinkedConstOperation.pushInt, |
| 1794 [UnlinkedConstOperation.pushInt, UnlinkedConstOperation.shiftOr,], | 1845 UnlinkedConstOperation.shiftOr, |
| 1795 ints: [1, 0,]); | 1846 ], ints: [ |
| 1847 1, | |
| 1848 0, | |
| 1849 ]); | |
| 1796 } | 1850 } |
| 1797 | 1851 |
| 1798 test_constExpr_pushInt_shiftOr_min2() { | 1852 test_constExpr_pushInt_shiftOr_min2() { |
| 1799 UnlinkedVariable variable = | 1853 UnlinkedVariable variable = |
| 1800 serializeVariableText('const v = 0x10000000000000000;'); | 1854 serializeVariableText('const v = 0x10000000000000000;'); |
| 1801 _assertUnlinkedConst(variable.constExpr, operators: [ | 1855 _assertUnlinkedConst(variable.constExpr, operators: [ |
| 1802 UnlinkedConstOperation.pushInt, | 1856 UnlinkedConstOperation.pushInt, |
| 1803 UnlinkedConstOperation.shiftOr, | 1857 UnlinkedConstOperation.shiftOr, |
| 1804 UnlinkedConstOperation.shiftOr, | 1858 UnlinkedConstOperation.shiftOr, |
| 1805 ], ints: [ | 1859 ], ints: [ |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2579 expect(executable.isFactory, false); | 2633 expect(executable.isFactory, false); |
| 2580 expect(executable.isStatic, false); | 2634 expect(executable.isStatic, false); |
| 2581 expect(executable.parameters, hasLength(1)); | 2635 expect(executable.parameters, hasLength(1)); |
| 2582 checkTypeRef(executable.returnType, null, null, 'C'); | 2636 checkTypeRef(executable.returnType, null, null, 'C'); |
| 2583 expect(executable.typeParameters, isEmpty); | 2637 expect(executable.typeParameters, isEmpty); |
| 2584 expect(executable.isExternal, false); | 2638 expect(executable.isExternal, false); |
| 2585 } | 2639 } |
| 2586 | 2640 |
| 2587 test_executable_operator_equal() { | 2641 test_executable_operator_equal() { |
| 2588 UnlinkedExecutable executable = serializeClassText( | 2642 UnlinkedExecutable executable = serializeClassText( |
| 2589 'class C { bool operator==(Object other) => false; }').executables[0]; | 2643 'class C { bool operator==(Object other) => false; }') |
| 2644 .executables[0]; | |
| 2590 expect(executable.name, '=='); | 2645 expect(executable.name, '=='); |
| 2591 } | 2646 } |
| 2592 | 2647 |
| 2593 test_executable_operator_external() { | 2648 test_executable_operator_external() { |
| 2594 UnlinkedExecutable executable = | 2649 UnlinkedExecutable executable = |
| 2595 serializeClassText('class C { external C operator+(C c); }') | 2650 serializeClassText('class C { external C operator+(C c); }') |
| 2596 .executables[0]; | 2651 .executables[0]; |
| 2597 expect(executable.isExternal, true); | 2652 expect(executable.isExternal, true); |
| 2598 } | 2653 } |
| 2599 | 2654 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 2615 expect(executable.isConst, false); | 2670 expect(executable.isConst, false); |
| 2616 expect(executable.isFactory, false); | 2671 expect(executable.isFactory, false); |
| 2617 expect(executable.isStatic, false); | 2672 expect(executable.isStatic, false); |
| 2618 expect(executable.parameters, hasLength(1)); | 2673 expect(executable.parameters, hasLength(1)); |
| 2619 checkTypeRef(executable.returnType, 'dart:core', 'dart:core', 'bool'); | 2674 checkTypeRef(executable.returnType, 'dart:core', 'dart:core', 'bool'); |
| 2620 expect(executable.typeParameters, isEmpty); | 2675 expect(executable.typeParameters, isEmpty); |
| 2621 } | 2676 } |
| 2622 | 2677 |
| 2623 test_executable_operator_index_set() { | 2678 test_executable_operator_index_set() { |
| 2624 UnlinkedExecutable executable = serializeClassText( | 2679 UnlinkedExecutable executable = serializeClassText( |
| 2625 'class C { void operator[]=(int i, bool v) => null; }').executables[0]; | 2680 'class C { void operator[]=(int i, bool v) => null; }') |
| 2681 .executables[0]; | |
| 2626 expect(executable.kind, UnlinkedExecutableKind.functionOrMethod); | 2682 expect(executable.kind, UnlinkedExecutableKind.functionOrMethod); |
| 2627 expect(executable.name, '[]='); | 2683 expect(executable.name, '[]='); |
| 2628 expect(executable.returnType, isNotNull); | 2684 expect(executable.returnType, isNotNull); |
| 2629 expect(executable.isAbstract, false); | 2685 expect(executable.isAbstract, false); |
| 2630 expect(executable.isConst, false); | 2686 expect(executable.isConst, false); |
| 2631 expect(executable.isFactory, false); | 2687 expect(executable.isFactory, false); |
| 2632 expect(executable.isStatic, false); | 2688 expect(executable.isStatic, false); |
| 2633 expect(executable.parameters, hasLength(2)); | 2689 expect(executable.parameters, hasLength(2)); |
| 2634 checkVoidTypeRef(executable.returnType); | 2690 checkVoidTypeRef(executable.returnType); |
| 2635 expect(executable.typeParameters, isEmpty); | 2691 expect(executable.typeParameters, isEmpty); |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3438 checkUnresolvedTypeRef( | 3494 checkUnresolvedTypeRef( |
| 3439 serializeTypeText('dynamic.T', allowErrors: true), 'dynamic', 'T'); | 3495 serializeTypeText('dynamic.T', allowErrors: true), 'dynamic', 'T'); |
| 3440 } | 3496 } |
| 3441 | 3497 |
| 3442 test_invalid_prefix_type_parameter() { | 3498 test_invalid_prefix_type_parameter() { |
| 3443 if (checkAstDerivedData) { | 3499 if (checkAstDerivedData) { |
| 3444 // TODO(paulberry): get this to work properly. | 3500 // TODO(paulberry): get this to work properly. |
| 3445 return; | 3501 return; |
| 3446 } | 3502 } |
| 3447 checkUnresolvedTypeRef( | 3503 checkUnresolvedTypeRef( |
| 3448 serializeClassText('class C<T> { T.U x; }', allowErrors: true).fields[0] | 3504 serializeClassText('class C<T> { T.U x; }', allowErrors: true) |
| 3505 .fields[0] | |
| 3449 .type, | 3506 .type, |
| 3450 'T', | 3507 'T', |
| 3451 'U'); | 3508 'U'); |
| 3452 } | 3509 } |
| 3453 | 3510 |
| 3454 test_invalid_prefix_void() { | 3511 test_invalid_prefix_void() { |
| 3455 if (checkAstDerivedData) { | 3512 if (checkAstDerivedData) { |
| 3456 // TODO(paulberry): get this to work properly. | 3513 // TODO(paulberry): get this to work properly. |
| 3457 return; | 3514 return; |
| 3458 } | 3515 } |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4250 expect(constExpr.operations, operators); | 4307 expect(constExpr.operations, operators); |
| 4251 expect(constExpr.ints, ints); | 4308 expect(constExpr.ints, ints); |
| 4252 expect(constExpr.doubles, doubles); | 4309 expect(constExpr.doubles, doubles); |
| 4253 expect(constExpr.strings, strings); | 4310 expect(constExpr.strings, strings); |
| 4254 expect(constExpr.references, hasLength(referenceValidators.length)); | 4311 expect(constExpr.references, hasLength(referenceValidators.length)); |
| 4255 for (int i = 0; i < referenceValidators.length; i++) { | 4312 for (int i = 0; i < referenceValidators.length; i++) { |
| 4256 referenceValidators[i](constExpr.references[i]); | 4313 referenceValidators[i](constExpr.references[i]); |
| 4257 } | 4314 } |
| 4258 } | 4315 } |
| 4259 } | 4316 } |
| OLD | NEW |