| 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.non_error_resolver_test; | 5 library analyzer.test.generated.non_error_resolver_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/error/error.dart'; |
| 10 import 'package:analyzer/src/error/codes.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 11 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/error.dart'; | |
| 11 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; | 12 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
| 12 import 'package:analyzer/src/generated/source_io.dart'; | 13 import 'package:analyzer/src/generated/source_io.dart'; |
| 14 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 13 import 'package:unittest/unittest.dart'; | 15 import 'package:unittest/unittest.dart'; |
| 14 | 16 |
| 15 import '../reflective_tests.dart'; | |
| 16 import '../utils.dart'; | 17 import '../utils.dart'; |
| 17 import 'resolver_test.dart'; | 18 import 'resolver_test_case.dart'; |
| 18 import 'test_support.dart'; | 19 import 'test_support.dart'; |
| 19 | 20 |
| 20 main() { | 21 main() { |
| 21 initializeTestEnvironment(); | 22 initializeTestEnvironment(); |
| 22 runReflectiveTests(NonErrorResolverTest); | 23 defineReflectiveTests(NonErrorResolverTest); |
| 23 } | 24 } |
| 24 | 25 |
| 25 @reflectiveTest | 26 @reflectiveTest |
| 26 class NonErrorResolverTest extends ResolverTestCase { | 27 class NonErrorResolverTest extends ResolverTestCase { |
| 27 void fail_undefinedEnumConstant() { | 28 void fail_undefinedEnumConstant() { |
| 28 Source source = addSource(r''' | 29 Source source = addSource(r''' |
| 29 enum E { ONE } | 30 enum E { ONE } |
| 30 E e() { | 31 E e() { |
| 31 return E.TWO; | 32 return E.TWO; |
| 32 }'''); | 33 }'''); |
| 33 computeLibrarySourceErrors(source); | 34 computeLibrarySourceErrors(source); |
| 34 assertNoErrors(source); | 35 assertNoErrors(source); |
| 35 verify([source]); | 36 verify([source]); |
| 36 } | 37 } |
| 37 | 38 |
| 39 void test_abstractSuperMemberReference_superHasNoSuchMethod() { |
| 40 Source source = addSource(''' |
| 41 abstract class A { |
| 42 int m(); |
| 43 noSuchMethod(_) => 42; |
| 44 } |
| 45 |
| 46 class B extends A { |
| 47 int m() => super.m(); |
| 48 } |
| 49 '''); |
| 50 computeLibrarySourceErrors(source); |
| 51 assertNoErrors(source); |
| 52 verify([source]); |
| 53 } |
| 54 |
| 55 void test_abstractSuperMemberReference_superSuperHasConcrete_getter() { |
| 56 Source source = addSource(''' |
| 57 abstract class A { |
| 58 int get m => 0; |
| 59 } |
| 60 |
| 61 abstract class B extends A { |
| 62 int get m; |
| 63 } |
| 64 |
| 65 class C extends B { |
| 66 int get m => super.m; |
| 67 } |
| 68 '''); |
| 69 computeLibrarySourceErrors(source); |
| 70 assertNoErrors(source); |
| 71 verify([source]); |
| 72 } |
| 73 |
| 74 void test_abstractSuperMemberReference_superSuperHasConcrete_method() { |
| 75 Source source = addSource(''' |
| 76 void main() { |
| 77 print(new C().m()); |
| 78 } |
| 79 |
| 80 abstract class A { |
| 81 int m() => 0; |
| 82 } |
| 83 |
| 84 abstract class B extends A { |
| 85 int m(); |
| 86 } |
| 87 |
| 88 class C extends B { |
| 89 int m() => super.m(); |
| 90 } |
| 91 '''); |
| 92 computeLibrarySourceErrors(source); |
| 93 assertNoErrors(source); |
| 94 verify([source]); |
| 95 } |
| 96 |
| 97 void test_abstractSuperMemberReference_superSuperHasConcrete_setter() { |
| 98 Source source = addSource(''' |
| 99 abstract class A { |
| 100 void set m(int v) {} |
| 101 } |
| 102 |
| 103 abstract class B extends A { |
| 104 void set m(int v); |
| 105 } |
| 106 |
| 107 class C extends B { |
| 108 void set m(int v) { |
| 109 super.m = 0; |
| 110 } |
| 111 } |
| 112 '''); |
| 113 computeLibrarySourceErrors(source); |
| 114 assertNoErrors(source); |
| 115 verify([source]); |
| 116 } |
| 117 |
| 38 void test_ambiguousExport() { | 118 void test_ambiguousExport() { |
| 39 Source source = addSource(r''' | 119 Source source = addSource(r''' |
| 40 library L; | 120 library L; |
| 41 export 'lib1.dart'; | 121 export 'lib1.dart'; |
| 42 export 'lib2.dart';'''); | 122 export 'lib2.dart';'''); |
| 43 addNamedSource( | 123 addNamedSource( |
| 44 "/lib1.dart", | 124 "/lib1.dart", |
| 45 r''' | 125 r''' |
| 46 library lib1; | 126 library lib1; |
| 47 class M {}'''); | 127 class M {}'''); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 library lib1; | 240 library lib1; |
| 161 class N {} | 241 class N {} |
| 162 class N1 {}'''); | 242 class N1 {}'''); |
| 163 addNamedSource( | 243 addNamedSource( |
| 164 "/lib2.dart", | 244 "/lib2.dart", |
| 165 r''' | 245 r''' |
| 166 library lib2; | 246 library lib2; |
| 167 class N {} | 247 class N {} |
| 168 class N2 {}'''); | 248 class N2 {}'''); |
| 169 computeLibrarySourceErrors(source); | 249 computeLibrarySourceErrors(source); |
| 250 assertErrors(source, [HintCode.UNUSED_SHOWN_NAME]); |
| 251 } |
| 252 |
| 253 void test_annotated_partOfDeclaration() { |
| 254 Source source = addSource('library L; part "part.dart";'); |
| 255 addNamedSource('/part.dart', '@deprecated part of L;'); |
| 256 computeLibrarySourceErrors(source); |
| 170 assertNoErrors(source); | 257 assertNoErrors(source); |
| 258 verify([source]); |
| 171 } | 259 } |
| 172 | 260 |
| 173 void test_argumentTypeNotAssignable_classWithCall_Function() { | 261 void test_argumentTypeNotAssignable_classWithCall_Function() { |
| 174 Source source = addSource(r''' | 262 Source source = addSource(r''' |
| 175 caller(Function callee) { | 263 caller(Function callee) { |
| 176 callee(); | 264 callee(); |
| 177 } | 265 } |
| 178 | 266 |
| 179 class CallMeBack { | 267 class CallMeBack { |
| 180 call() => 0; | 268 call() => 0; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 Source source = addSource(r''' | 343 Source source = addSource(r''' |
| 256 typedef A(int p1, String p2); | 344 typedef A(int p1, String p2); |
| 257 f(A a) { | 345 f(A a) { |
| 258 a(1, '2'); | 346 a(1, '2'); |
| 259 }'''); | 347 }'''); |
| 260 computeLibrarySourceErrors(source); | 348 computeLibrarySourceErrors(source); |
| 261 assertNoErrors(source); | 349 assertNoErrors(source); |
| 262 verify([source]); | 350 verify([source]); |
| 263 } | 351 } |
| 264 | 352 |
| 353 void test_assert_with_message_await() { |
| 354 resetWithOptions(new AnalysisOptionsImpl()..enableAssertMessage = true); |
| 355 Source source = addSource(''' |
| 356 import 'dart:async'; |
| 357 f() async { |
| 358 assert(false, await g()); |
| 359 } |
| 360 Future<String> g() => null; |
| 361 '''); |
| 362 computeLibrarySourceErrors(source); |
| 363 assertNoErrors(source); |
| 364 verify([source]); |
| 365 } |
| 366 |
| 367 void test_assert_with_message_dynamic() { |
| 368 resetWithOptions(new AnalysisOptionsImpl()..enableAssertMessage = true); |
| 369 Source source = addSource(''' |
| 370 f() { |
| 371 assert(false, g()); |
| 372 } |
| 373 g() => null; |
| 374 '''); |
| 375 computeLibrarySourceErrors(source); |
| 376 assertNoErrors(source); |
| 377 verify([source]); |
| 378 } |
| 379 |
| 380 void test_assert_with_message_non_string() { |
| 381 resetWithOptions(new AnalysisOptionsImpl()..enableAssertMessage = true); |
| 382 Source source = addSource(''' |
| 383 f() { |
| 384 assert(false, 3); |
| 385 } |
| 386 '''); |
| 387 computeLibrarySourceErrors(source); |
| 388 assertNoErrors(source); |
| 389 verify([source]); |
| 390 } |
| 391 |
| 392 void test_assert_with_message_null() { |
| 393 resetWithOptions(new AnalysisOptionsImpl()..enableAssertMessage = true); |
| 394 Source source = addSource(''' |
| 395 f() { |
| 396 assert(false, null); |
| 397 } |
| 398 '''); |
| 399 computeLibrarySourceErrors(source); |
| 400 assertNoErrors(source); |
| 401 verify([source]); |
| 402 } |
| 403 |
| 404 void test_assert_with_message_string() { |
| 405 resetWithOptions(new AnalysisOptionsImpl()..enableAssertMessage = true); |
| 406 Source source = addSource(''' |
| 407 f() { |
| 408 assert(false, 'message'); |
| 409 } |
| 410 '''); |
| 411 computeLibrarySourceErrors(source); |
| 412 assertNoErrors(source); |
| 413 verify([source]); |
| 414 } |
| 415 |
| 416 void test_assert_with_message_suppresses_unused_var_hint() { |
| 417 resetWithOptions(new AnalysisOptionsImpl()..enableAssertMessage = true); |
| 418 Source source = addSource(''' |
| 419 f() { |
| 420 String message = 'msg'; |
| 421 assert(true, message); |
| 422 } |
| 423 '''); |
| 424 computeLibrarySourceErrors(source); |
| 425 assertNoErrors(source); |
| 426 verify([source]); |
| 427 } |
| 428 |
| 265 void test_assignability_function_expr_rettype_from_typedef_cls() { | 429 void test_assignability_function_expr_rettype_from_typedef_cls() { |
| 266 // In the code below, the type of (() => f()) has a return type which is | 430 // In the code below, the type of (() => f()) has a return type which is |
| 267 // a class, and that class is inferred from the return type of the typedef | 431 // a class, and that class is inferred from the return type of the typedef |
| 268 // F. | 432 // F. |
| 269 Source source = addSource(''' | 433 Source source = addSource(''' |
| 270 class C {} | 434 class C {} |
| 271 typedef C F(); | 435 typedef C F(); |
| 272 F f; | 436 F f; |
| 273 main() { | 437 main() { |
| 274 F f2 = (() => f()); | 438 F f2 = (() => f()); |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 switch(s) { | 995 switch(s) { |
| 832 case('1') : return 1; | 996 case('1') : return 1; |
| 833 default: return 0; | 997 default: return 0; |
| 834 } | 998 } |
| 835 }'''); | 999 }'''); |
| 836 computeLibrarySourceErrors(source); | 1000 computeLibrarySourceErrors(source); |
| 837 assertNoErrors(source); | 1001 assertNoErrors(source); |
| 838 verify([source]); | 1002 verify([source]); |
| 839 } | 1003 } |
| 840 | 1004 |
| 1005 void test_class_type_alias_documentationComment() { |
| 1006 Source source = addSource(''' |
| 1007 /** |
| 1008 * Documentation |
| 1009 */ |
| 1010 class C = D with E; |
| 1011 |
| 1012 class D {} |
| 1013 class E {}'''); |
| 1014 computeLibrarySourceErrors(source); |
| 1015 computeLibrarySourceErrors(source); |
| 1016 assertNoErrors(source); |
| 1017 verify([source]); |
| 1018 CompilationUnit unit = _getResolvedLibraryUnit(source); |
| 1019 ClassElement classC = unit.element.getType('C'); |
| 1020 expect(classC.documentationComment, isNotNull); |
| 1021 } |
| 1022 |
| 841 void test_commentReference_beforeConstructor() { | 1023 void test_commentReference_beforeConstructor() { |
| 842 String code = r''' | 1024 String code = r''' |
| 843 abstract class A { | 1025 abstract class A { |
| 844 /// [p] | 1026 /// [p] |
| 845 A(int p) {} | 1027 A(int p) {} |
| 846 }'''; | 1028 }'''; |
| 847 Source source = addSource(code); | 1029 Source source = addSource(code); |
| 848 computeLibrarySourceErrors(source); | 1030 computeLibrarySourceErrors(source); |
| 849 assertNoErrors(source); | 1031 assertNoErrors(source); |
| 850 verify([source]); | 1032 verify([source]); |
| 851 CompilationUnit unit = _getResolvedLibraryUnit(source); | 1033 CompilationUnit unit = _getResolvedLibraryUnit(source); |
| 852 { | 1034 { |
| 853 SimpleIdentifier ref = EngineTestCase.findNode( | 1035 SimpleIdentifier ref = |
| 854 unit, code, "p]", (node) => node is SimpleIdentifier); | 1036 EngineTestCase.findSimpleIdentifier(unit, code, "p]"); |
| 855 EngineTestCase.assertInstanceOf((obj) => obj is ParameterElement, | 1037 expect(ref.staticElement, new isInstanceOf<ParameterElement>()); |
| 856 ParameterElement, ref.staticElement); | |
| 857 } | 1038 } |
| 858 } | 1039 } |
| 859 | 1040 |
| 860 void test_commentReference_beforeEnum() { | 1041 void test_commentReference_beforeEnum() { |
| 861 String code = r''' | 1042 String code = r''' |
| 862 /// This is the [Samurai] kind. | 1043 /// This is the [Samurai] kind. |
| 863 enum Samurai { | 1044 enum Samurai { |
| 864 /// Use [int]. | 1045 /// Use [int]. |
| 865 WITH_SWORD, | 1046 WITH_SWORD, |
| 866 /// Like [WITH_SWORD], but only without one. | 1047 /// Like [WITH_SWORD], but only without one. |
| 867 WITHOUT_SWORD | 1048 WITHOUT_SWORD |
| 868 }'''; | 1049 }'''; |
| 869 Source source = addSource(code); | 1050 Source source = addSource(code); |
| 870 computeLibrarySourceErrors(source); | 1051 computeLibrarySourceErrors(source); |
| 871 assertNoErrors(source); | 1052 assertNoErrors(source); |
| 872 verify([source]); | 1053 verify([source]); |
| 873 CompilationUnit unit = _getResolvedLibraryUnit(source); | 1054 CompilationUnit unit = _getResolvedLibraryUnit(source); |
| 874 { | 1055 { |
| 875 SimpleIdentifier ref = EngineTestCase.findNode( | 1056 SimpleIdentifier ref = |
| 876 unit, code, "Samurai]", (node) => node is SimpleIdentifier); | 1057 EngineTestCase.findSimpleIdentifier(unit, code, 'Samurai]'); |
| 877 ClassElement refElement = ref.staticElement; | 1058 ClassElement refElement = ref.staticElement; |
| 878 expect(refElement, isNotNull); | 1059 expect(refElement, isNotNull); |
| 879 expect(refElement.name, 'Samurai'); | 1060 expect(refElement.name, 'Samurai'); |
| 880 } | 1061 } |
| 881 { | 1062 { |
| 882 SimpleIdentifier ref = EngineTestCase.findNode( | 1063 SimpleIdentifier ref = |
| 883 unit, code, "int]", (node) => node is SimpleIdentifier); | 1064 EngineTestCase.findSimpleIdentifier(unit, code, 'int]'); |
| 884 ClassElement refElement = ref.staticElement; | 1065 ClassElement refElement = ref.staticElement; |
| 885 expect(refElement, isNotNull); | 1066 expect(refElement, isNotNull); |
| 886 expect(refElement.name, 'int'); | 1067 expect(refElement.name, 'int'); |
| 887 } | 1068 } |
| 888 { | 1069 { |
| 889 SimpleIdentifier ref = EngineTestCase.findNode( | 1070 SimpleIdentifier ref = |
| 890 unit, code, "WITH_SWORD]", (node) => node is SimpleIdentifier); | 1071 EngineTestCase.findSimpleIdentifier(unit, code, 'WITH_SWORD]'); |
| 891 PropertyAccessorElement refElement = ref.staticElement; | 1072 PropertyAccessorElement refElement = ref.staticElement; |
| 892 expect(refElement, isNotNull); | 1073 expect(refElement, isNotNull); |
| 893 expect(refElement.name, 'WITH_SWORD'); | 1074 expect(refElement.name, 'WITH_SWORD'); |
| 894 } | 1075 } |
| 895 } | 1076 } |
| 896 | 1077 |
| 897 void test_commentReference_beforeFunction_blockBody() { | 1078 void test_commentReference_beforeFunction_blockBody() { |
| 898 String code = r''' | 1079 String code = r''' |
| 899 /// [p] | 1080 /// [p] |
| 900 foo(int p) { | 1081 foo(int p) { |
| 901 }'''; | 1082 }'''; |
| 902 Source source = addSource(code); | 1083 Source source = addSource(code); |
| 903 computeLibrarySourceErrors(source); | 1084 computeLibrarySourceErrors(source); |
| 904 assertNoErrors(source); | 1085 assertNoErrors(source); |
| 905 verify([source]); | 1086 verify([source]); |
| 906 CompilationUnit unit = _getResolvedLibraryUnit(source); | 1087 CompilationUnit unit = _getResolvedLibraryUnit(source); |
| 907 SimpleIdentifier ref = EngineTestCase.findNode( | 1088 SimpleIdentifier ref = |
| 908 unit, code, "p]", (node) => node is SimpleIdentifier); | 1089 EngineTestCase.findSimpleIdentifier(unit, code, 'p]'); |
| 909 EngineTestCase.assertInstanceOf( | 1090 expect(ref.staticElement, new isInstanceOf<ParameterElement>()); |
| 910 (obj) => obj is ParameterElement, ParameterElement, ref.staticElement); | |
| 911 } | 1091 } |
| 912 | 1092 |
| 913 void test_commentReference_beforeFunction_expressionBody() { | 1093 void test_commentReference_beforeFunction_expressionBody() { |
| 914 String code = r''' | 1094 String code = r''' |
| 915 /// [p] | 1095 /// [p] |
| 916 foo(int p) => null;'''; | 1096 foo(int p) => null;'''; |
| 917 Source source = addSource(code); | 1097 Source source = addSource(code); |
| 918 computeLibrarySourceErrors(source); | 1098 computeLibrarySourceErrors(source); |
| 919 assertNoErrors(source); | 1099 assertNoErrors(source); |
| 920 verify([source]); | 1100 verify([source]); |
| 921 CompilationUnit unit = _getResolvedLibraryUnit(source); | 1101 CompilationUnit unit = _getResolvedLibraryUnit(source); |
| 922 SimpleIdentifier ref = EngineTestCase.findNode( | 1102 SimpleIdentifier ref = |
| 923 unit, code, "p]", (node) => node is SimpleIdentifier); | 1103 EngineTestCase.findSimpleIdentifier(unit, code, 'p]'); |
| 924 EngineTestCase.assertInstanceOf( | 1104 expect(ref.staticElement, new isInstanceOf<ParameterElement>()); |
| 925 (obj) => obj is ParameterElement, ParameterElement, ref.staticElement); | 1105 } |
| 1106 |
| 1107 void test_commentReference_beforeFunctionTypeAlias() { |
| 1108 String code = r''' |
| 1109 /// [p] |
| 1110 typedef Foo(int p); |
| 1111 '''; |
| 1112 Source source = addSource(code); |
| 1113 computeLibrarySourceErrors(source); |
| 1114 assertNoErrors(source); |
| 1115 verify([source]); |
| 1116 CompilationUnit unit = _getResolvedLibraryUnit(source); |
| 1117 SimpleIdentifier ref = |
| 1118 EngineTestCase.findSimpleIdentifier(unit, code, 'p]'); |
| 1119 expect(ref.staticElement, new isInstanceOf<ParameterElement>()); |
| 1120 } |
| 1121 |
| 1122 void test_commentReference_beforeGetter() { |
| 1123 String code = r''' |
| 1124 abstract class A { |
| 1125 /// [int] |
| 1126 get g => null; |
| 1127 }'''; |
| 1128 Source source = addSource(code); |
| 1129 computeLibrarySourceErrors(source); |
| 1130 assertNoErrors(source); |
| 1131 verify([source]); |
| 1132 CompilationUnit unit = _getResolvedLibraryUnit(source); |
| 1133 { |
| 1134 SimpleIdentifier ref = |
| 1135 EngineTestCase.findSimpleIdentifier(unit, code, 'int]'); |
| 1136 expect(ref.staticElement, isNotNull); |
| 1137 } |
| 926 } | 1138 } |
| 927 | 1139 |
| 928 void test_commentReference_beforeMethod() { | 1140 void test_commentReference_beforeMethod() { |
| 929 String code = r''' | 1141 String code = r''' |
| 930 abstract class A { | 1142 abstract class A { |
| 931 /// [p1] | 1143 /// [p1] |
| 932 ma(int p1) {} | 1144 ma(int p1) {} |
| 933 /// [p2] | 1145 /// [p2] |
| 934 mb(int p2); | 1146 mb(int p2); |
| 1147 /// [p3] and [p4] |
| 1148 mc(int p3, p4()); |
| 1149 /// [p5] |
| 1150 md(int p5, {int p6}); |
| 935 }'''; | 1151 }'''; |
| 936 Source source = addSource(code); | 1152 Source source = addSource(code); |
| 937 computeLibrarySourceErrors(source); | 1153 computeLibrarySourceErrors(source); |
| 938 assertNoErrors(source); | 1154 assertNoErrors(source); |
| 939 verify([source]); | 1155 verify([source]); |
| 940 CompilationUnit unit = _getResolvedLibraryUnit(source); | 1156 CompilationUnit unit = _getResolvedLibraryUnit(source); |
| 941 { | 1157 assertIsParameter(String search) { |
| 942 SimpleIdentifier ref = EngineTestCase.findNode( | 1158 SimpleIdentifier ref = |
| 943 unit, code, "p1]", (node) => node is SimpleIdentifier); | 1159 EngineTestCase.findSimpleIdentifier(unit, code, search); |
| 944 EngineTestCase.assertInstanceOf((obj) => obj is ParameterElement, | 1160 expect(ref.staticElement, new isInstanceOf<ParameterElement>()); |
| 945 ParameterElement, ref.staticElement); | |
| 946 } | 1161 } |
| 947 { | 1162 |
| 948 SimpleIdentifier ref = EngineTestCase.findNode( | 1163 assertIsParameter('p1'); |
| 949 unit, code, "p2]", (node) => node is SimpleIdentifier); | 1164 assertIsParameter('p2'); |
| 950 EngineTestCase.assertInstanceOf((obj) => obj is ParameterElement, | 1165 assertIsParameter('p3'); |
| 951 ParameterElement, ref.staticElement); | 1166 assertIsParameter('p4'); |
| 952 } | 1167 assertIsParameter('p5'); |
| 1168 assertIsParameter('p6'); |
| 953 } | 1169 } |
| 954 | 1170 |
| 955 void test_commentReference_class() { | 1171 void test_commentReference_class() { |
| 956 String code = r''' | 1172 String code = r''' |
| 957 /// [foo] | 1173 /// [foo] |
| 958 class A { | 1174 class A { |
| 959 foo() {} | 1175 foo() {} |
| 960 }'''; | 1176 }'''; |
| 961 Source source = addSource(code); | 1177 Source source = addSource(code); |
| 962 computeLibrarySourceErrors(source); | 1178 computeLibrarySourceErrors(source); |
| 963 assertNoErrors(source); | 1179 assertNoErrors(source); |
| 964 verify([source]); | 1180 verify([source]); |
| 965 CompilationUnit unit = _getResolvedLibraryUnit(source); | 1181 CompilationUnit unit = _getResolvedLibraryUnit(source); |
| 966 SimpleIdentifier ref = EngineTestCase.findNode( | 1182 SimpleIdentifier ref = |
| 967 unit, code, "foo]", (node) => node is SimpleIdentifier); | 1183 EngineTestCase.findSimpleIdentifier(unit, code, 'foo]'); |
| 968 EngineTestCase.assertInstanceOf( | 1184 expect(ref.staticElement, new isInstanceOf<MethodElement>()); |
| 969 (obj) => obj is MethodElement, MethodElement, ref.staticElement); | |
| 970 } | 1185 } |
| 971 | 1186 |
| 972 void test_commentReference_setter() { | 1187 void test_commentReference_setter() { |
| 973 String code = r''' | 1188 String code = r''' |
| 974 class A { | 1189 class A { |
| 975 /// [x] in A | 1190 /// [x] in A |
| 976 mA() {} | 1191 mA() {} |
| 977 set x(value) {} | 1192 set x(value) {} |
| 978 } | 1193 } |
| 979 class B extends A { | 1194 class B extends A { |
| 980 /// [x] in B | 1195 /// [x] in B |
| 981 mB() {} | 1196 mB() {} |
| 982 } | 1197 } |
| 983 '''; | 1198 '''; |
| 984 Source source = addSource(code); | 1199 Source source = addSource(code); |
| 985 computeLibrarySourceErrors(source); | 1200 computeLibrarySourceErrors(source); |
| 986 assertNoErrors(source); | 1201 assertNoErrors(source); |
| 987 verify([source]); | 1202 verify([source]); |
| 988 CompilationUnit unit = _getResolvedLibraryUnit(source); | 1203 CompilationUnit unit = _getResolvedLibraryUnit(source); |
| 989 { | 1204 { |
| 990 SimpleIdentifier ref = EngineTestCase.findNode( | 1205 SimpleIdentifier ref = |
| 991 unit, code, "x] in A", (node) => node is SimpleIdentifier); | 1206 EngineTestCase.findSimpleIdentifier(unit, code, "x] in A"); |
| 992 EngineTestCase.assertInstanceOf((obj) => obj is PropertyAccessorElement, | 1207 expect(ref.staticElement, new isInstanceOf<PropertyAccessorElement>()); |
| 993 PropertyAccessorElement, ref.staticElement); | |
| 994 } | 1208 } |
| 995 { | 1209 { |
| 996 SimpleIdentifier ref = EngineTestCase.findNode( | 1210 SimpleIdentifier ref = |
| 997 unit, code, "x] in B", (node) => node is SimpleIdentifier); | 1211 EngineTestCase.findSimpleIdentifier(unit, code, 'x] in B'); |
| 998 EngineTestCase.assertInstanceOf((obj) => obj is PropertyAccessorElement, | 1212 expect(ref.staticElement, new isInstanceOf<PropertyAccessorElement>()); |
| 999 PropertyAccessorElement, ref.staticElement); | |
| 1000 } | 1213 } |
| 1001 } | 1214 } |
| 1002 | 1215 |
| 1003 void test_concreteClassWithAbstractMember() { | 1216 void test_concreteClassWithAbstractMember() { |
| 1004 Source source = addSource(r''' | 1217 Source source = addSource(r''' |
| 1005 abstract class A { | 1218 abstract class A { |
| 1006 m(); | 1219 m(); |
| 1007 }'''); | 1220 }'''); |
| 1008 computeLibrarySourceErrors(source); | 1221 computeLibrarySourceErrors(source); |
| 1009 assertNoErrors(source); | 1222 assertNoErrors(source); |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 void test_constNotInitialized_local() { | 1551 void test_constNotInitialized_local() { |
| 1339 Source source = addSource(r''' | 1552 Source source = addSource(r''' |
| 1340 main() { | 1553 main() { |
| 1341 const int x = 0; | 1554 const int x = 0; |
| 1342 }'''); | 1555 }'''); |
| 1343 computeLibrarySourceErrors(source); | 1556 computeLibrarySourceErrors(source); |
| 1344 assertNoErrors(source); | 1557 assertNoErrors(source); |
| 1345 verify([source]); | 1558 verify([source]); |
| 1346 } | 1559 } |
| 1347 | 1560 |
| 1561 void test_constRedirectSkipsSupertype() { |
| 1562 // Since C redirects to C.named, it doesn't implicitly refer to B's |
| 1563 // unnamed constructor. Therefore there is no cycle. |
| 1564 Source source = addSource(''' |
| 1565 class B { |
| 1566 final x; |
| 1567 const B() : x = y; |
| 1568 const B.named() : x = null; |
| 1569 } |
| 1570 class C extends B { |
| 1571 const C() : this.named(); |
| 1572 const C.named() : super.named(); |
| 1573 } |
| 1574 const y = const C(); |
| 1575 '''); |
| 1576 computeLibrarySourceErrors(source); |
| 1577 assertNoErrors(source); |
| 1578 verify([source]); |
| 1579 } |
| 1580 |
| 1348 void test_constructorDeclaration_scope_signature() { | 1581 void test_constructorDeclaration_scope_signature() { |
| 1349 Source source = addSource(r''' | 1582 Source source = addSource(r''' |
| 1350 const app = 0; | 1583 const app = 0; |
| 1351 class A { | 1584 class A { |
| 1352 A(@app int app) {} | 1585 A(@app int app) {} |
| 1353 }'''); | 1586 }'''); |
| 1354 computeLibrarySourceErrors(source); | 1587 computeLibrarySourceErrors(source); |
| 1355 assertNoErrors(source); | 1588 assertNoErrors(source); |
| 1356 verify([source]); | 1589 verify([source]); |
| 1357 } | 1590 } |
| 1358 | 1591 |
| 1592 void test_constWithNonConstantArgument_constField() { |
| 1593 Source source = addSource(r''' |
| 1594 class A { |
| 1595 const A(x); |
| 1596 } |
| 1597 main() { |
| 1598 const A(double.INFINITY); |
| 1599 }'''); |
| 1600 computeLibrarySourceErrors(source); |
| 1601 assertNoErrors(source); |
| 1602 verify([source]); |
| 1603 } |
| 1604 |
| 1359 void test_constWithNonConstantArgument_literals() { | 1605 void test_constWithNonConstantArgument_literals() { |
| 1360 Source source = addSource(r''' | 1606 Source source = addSource(r''' |
| 1361 class A { | 1607 class A { |
| 1362 const A(a, b, c, d); | 1608 const A(a, b, c, d); |
| 1363 } | 1609 } |
| 1364 f() { return const A(true, 0, 1.0, '2'); }'''); | 1610 f() { return const A(true, 0, 1.0, '2'); }'''); |
| 1365 computeLibrarySourceErrors(source); | 1611 computeLibrarySourceErrors(source); |
| 1366 assertNoErrors(source); | 1612 assertNoErrors(source); |
| 1367 verify([source]); | 1613 verify([source]); |
| 1368 } | 1614 } |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1849 class A implements Function { | 2095 class A implements Function { |
| 1850 noSuchMethod(inv) { | 2096 noSuchMethod(inv) { |
| 1851 return 42; | 2097 return 42; |
| 1852 } | 2098 } |
| 1853 }'''); | 2099 }'''); |
| 1854 computeLibrarySourceErrors(source); | 2100 computeLibrarySourceErrors(source); |
| 1855 assertNoErrors(source); | 2101 assertNoErrors(source); |
| 1856 verify([source]); | 2102 verify([source]); |
| 1857 } | 2103 } |
| 1858 | 2104 |
| 2105 void test_functionWithoutCall_withNoSuchMethod_mixin() { |
| 2106 Source source = addSource(r''' |
| 2107 class A { |
| 2108 noSuchMethod(inv) {} |
| 2109 } |
| 2110 class B extends Object with A implements Function { |
| 2111 }'''); |
| 2112 computeLibrarySourceErrors(source); |
| 2113 assertNoErrors(source); |
| 2114 verify([source]); |
| 2115 } |
| 2116 |
| 2117 void test_functionWithoutCall_withNoSuchMethod_superclass() { |
| 2118 Source source = addSource(r''' |
| 2119 class A { |
| 2120 noSuchMethod(inv) {} |
| 2121 } |
| 2122 class B extends A implements Function { |
| 2123 }'''); |
| 2124 computeLibrarySourceErrors(source); |
| 2125 assertNoErrors(source); |
| 2126 verify([source]); |
| 2127 } |
| 2128 |
| 1859 void test_implicitConstructorDependencies() { | 2129 void test_implicitConstructorDependencies() { |
| 1860 // No warning should be generated for the code below; this requires that | 2130 // No warning should be generated for the code below; this requires that |
| 1861 // implicit constructors are generated for C1 before C2, even though C1 | 2131 // implicit constructors are generated for C1 before C2, even though C1 |
| 1862 // follows C2 in the file. See dartbug.com/21600. | 2132 // follows C2 in the file. See dartbug.com/21600. |
| 1863 Source source = addSource(r''' | 2133 Source source = addSource(r''' |
| 1864 class B { | 2134 class B { |
| 1865 B(int i); | 2135 B(int i); |
| 1866 } | 2136 } |
| 1867 class M1 {} | 2137 class M1 {} |
| 1868 class M2 {} | 2138 class M2 {} |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2631 g = () => 0; | 2901 g = () => 0; |
| 2632 }'''); | 2902 }'''); |
| 2633 computeLibrarySourceErrors(source); | 2903 computeLibrarySourceErrors(source); |
| 2634 assertNoErrors(source); | 2904 assertNoErrors(source); |
| 2635 verify([source]); | 2905 verify([source]); |
| 2636 } | 2906 } |
| 2637 | 2907 |
| 2638 void test_invalidFactoryNameNotAClass() { | 2908 void test_invalidFactoryNameNotAClass() { |
| 2639 Source source = addSource(r''' | 2909 Source source = addSource(r''' |
| 2640 class A { | 2910 class A { |
| 2641 factory A() {} | 2911 factory A() => null; |
| 2642 }'''); | 2912 }'''); |
| 2643 computeLibrarySourceErrors(source); | 2913 computeLibrarySourceErrors(source); |
| 2644 assertNoErrors(source); | 2914 assertNoErrors(source); |
| 2645 verify([source]); | 2915 verify([source]); |
| 2646 } | 2916 } |
| 2647 | 2917 |
| 2648 void test_invalidIdentifierInAsync() { | 2918 void test_invalidIdentifierInAsync() { |
| 2649 Source source = addSource(r''' | 2919 Source source = addSource(r''' |
| 2650 class A { | 2920 class A { |
| 2651 m() { | 2921 m() { |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2966 class B extends A { | 3236 class B extends A { |
| 2967 g() { | 3237 g() { |
| 2968 f(); | 3238 f(); |
| 2969 } | 3239 } |
| 2970 }'''); | 3240 }'''); |
| 2971 computeLibrarySourceErrors(source); | 3241 computeLibrarySourceErrors(source); |
| 2972 assertNoErrors(source); | 3242 assertNoErrors(source); |
| 2973 verify([source]); | 3243 verify([source]); |
| 2974 } | 3244 } |
| 2975 | 3245 |
| 3246 void test_invocationOfNonFunction_functionTypeTypeParameter() { |
| 3247 Source source = addSource(r''' |
| 3248 typedef void Action<T>(T x); |
| 3249 class C<T, U extends Action<T>> { |
| 3250 T value; |
| 3251 U action; |
| 3252 C(this.value, [this.action]); |
| 3253 void act() { |
| 3254 action(value); |
| 3255 } |
| 3256 } |
| 3257 '''); |
| 3258 computeLibrarySourceErrors(source); |
| 3259 assertNoErrors(source); |
| 3260 verify([source]); |
| 3261 } |
| 3262 |
| 2976 void test_invocationOfNonFunction_getter() { | 3263 void test_invocationOfNonFunction_getter() { |
| 2977 Source source = addSource(r''' | 3264 Source source = addSource(r''' |
| 2978 class A { | 3265 class A { |
| 2979 var g; | 3266 var g; |
| 2980 } | 3267 } |
| 2981 f() { | 3268 f() { |
| 2982 A a; | 3269 A a; |
| 2983 a.g(); | 3270 a.g(); |
| 2984 }'''); | 3271 }'''); |
| 2985 computeLibrarySourceErrors(source); | 3272 computeLibrarySourceErrors(source); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3295 } | 3582 } |
| 3296 class B extends Object with A {}'''); | 3583 class B extends Object with A {}'''); |
| 3297 computeLibrarySourceErrors(source); | 3584 computeLibrarySourceErrors(source); |
| 3298 assertNoErrors(source); | 3585 assertNoErrors(source); |
| 3299 verify([source]); | 3586 verify([source]); |
| 3300 } | 3587 } |
| 3301 | 3588 |
| 3302 void test_mixinDeclaresConstructor_factory() { | 3589 void test_mixinDeclaresConstructor_factory() { |
| 3303 Source source = addSource(r''' | 3590 Source source = addSource(r''' |
| 3304 class A { | 3591 class A { |
| 3305 factory A() {} | 3592 factory A() => null; |
| 3306 } | 3593 } |
| 3307 class B extends Object with A {}'''); | 3594 class B extends Object with A {}'''); |
| 3308 computeLibrarySourceErrors(source); | 3595 computeLibrarySourceErrors(source); |
| 3309 assertNoErrors(source); | 3596 assertNoErrors(source); |
| 3310 verify([source]); | 3597 verify([source]); |
| 3311 } | 3598 } |
| 3312 | 3599 |
| 3313 void test_mixinInheritsFromNotObject_classDeclaration_extends() { | 3600 void test_mixinInheritsFromNotObject_classDeclaration_extends() { |
| 3314 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); | 3601 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 3315 options.enableSuperMixins = true; | 3602 options.enableSuperMixins = true; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3462 A() {} | 3749 A() {} |
| 3463 } | 3750 } |
| 3464 f() { | 3751 f() { |
| 3465 new A(); | 3752 new A(); |
| 3466 }'''); | 3753 }'''); |
| 3467 computeLibrarySourceErrors(source); | 3754 computeLibrarySourceErrors(source); |
| 3468 assertNoErrors(source); | 3755 assertNoErrors(source); |
| 3469 verify([source]); | 3756 verify([source]); |
| 3470 } | 3757 } |
| 3471 | 3758 |
| 3472 void test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcr
etes_getter() { | 3759 void |
| 3760 test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcre
tes_getter() { |
| 3473 Source source = addSource(r''' | 3761 Source source = addSource(r''' |
| 3474 class A { | 3762 class A { |
| 3475 int get g => 0; | 3763 int get g => 0; |
| 3476 } | 3764 } |
| 3477 abstract class B extends A { | 3765 abstract class B extends A { |
| 3478 int get g; | 3766 int get g; |
| 3479 } | 3767 } |
| 3480 class C extends B {}'''); | 3768 class C extends B {}'''); |
| 3481 computeLibrarySourceErrors(source); | 3769 computeLibrarySourceErrors(source); |
| 3482 assertNoErrors(source); | 3770 assertNoErrors(source); |
| 3483 verify([source]); | 3771 verify([source]); |
| 3484 } | 3772 } |
| 3485 | 3773 |
| 3486 void test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcr
etes_method() { | 3774 void |
| 3775 test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcre
tes_method() { |
| 3487 Source source = addSource(r''' | 3776 Source source = addSource(r''' |
| 3488 class A { | 3777 class A { |
| 3489 m(p) {} | 3778 m(p) {} |
| 3490 } | 3779 } |
| 3491 abstract class B extends A { | 3780 abstract class B extends A { |
| 3492 m(p); | 3781 m(p); |
| 3493 } | 3782 } |
| 3494 class C extends B {}'''); | 3783 class C extends B {}'''); |
| 3495 computeLibrarySourceErrors(source); | 3784 computeLibrarySourceErrors(source); |
| 3496 assertNoErrors(source); | 3785 assertNoErrors(source); |
| 3497 verify([source]); | 3786 verify([source]); |
| 3498 } | 3787 } |
| 3499 | 3788 |
| 3500 void test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcr
etes_setter() { | 3789 void |
| 3790 test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcre
tes_setter() { |
| 3501 Source source = addSource(r''' | 3791 Source source = addSource(r''' |
| 3502 class A { | 3792 class A { |
| 3503 set s(v) {} | 3793 set s(v) {} |
| 3504 } | 3794 } |
| 3505 abstract class B extends A { | 3795 abstract class B extends A { |
| 3506 set s(v); | 3796 set s(v); |
| 3507 } | 3797 } |
| 3508 class C extends B {}'''); | 3798 class C extends B {}'''); |
| 3509 computeLibrarySourceErrors(source); | 3799 computeLibrarySourceErrors(source); |
| 3510 assertNoErrors(source); | 3800 assertNoErrors(source); |
| 3511 verify([source]); | 3801 verify([source]); |
| 3512 } | 3802 } |
| 3513 | 3803 |
| 3514 void test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_interface()
{ | 3804 void |
| 3805 test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_interface()
{ |
| 3515 // 15979 | 3806 // 15979 |
| 3516 Source source = addSource(r''' | 3807 Source source = addSource(r''' |
| 3517 abstract class M {} | 3808 abstract class M {} |
| 3518 abstract class A {} | 3809 abstract class A {} |
| 3519 abstract class I { | 3810 abstract class I { |
| 3520 m(); | 3811 m(); |
| 3521 } | 3812 } |
| 3522 abstract class B = A with M implements I;'''); | 3813 abstract class B = A with M implements I;'''); |
| 3523 computeLibrarySourceErrors(source); | 3814 computeLibrarySourceErrors(source); |
| 3524 assertNoErrors(source); | 3815 assertNoErrors(source); |
| 3525 verify([source]); | 3816 verify([source]); |
| 3526 } | 3817 } |
| 3527 | 3818 |
| 3528 void test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_mixin() { | 3819 void test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_mixin() { |
| 3529 // 15979 | 3820 // 15979 |
| 3530 Source source = addSource(r''' | 3821 Source source = addSource(r''' |
| 3531 abstract class M { | 3822 abstract class M { |
| 3532 m(); | 3823 m(); |
| 3533 } | 3824 } |
| 3534 abstract class A {} | 3825 abstract class A {} |
| 3535 abstract class B = A with M;'''); | 3826 abstract class B = A with M;'''); |
| 3536 computeLibrarySourceErrors(source); | 3827 computeLibrarySourceErrors(source); |
| 3537 assertNoErrors(source); | 3828 assertNoErrors(source); |
| 3538 verify([source]); | 3829 verify([source]); |
| 3539 } | 3830 } |
| 3540 | 3831 |
| 3541 void test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_superclass(
) { | 3832 void |
| 3833 test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_superclass()
{ |
| 3542 // 15979 | 3834 // 15979 |
| 3543 Source source = addSource(r''' | 3835 Source source = addSource(r''' |
| 3544 class M {} | 3836 class M {} |
| 3545 abstract class A { | 3837 abstract class A { |
| 3546 m(); | 3838 m(); |
| 3547 } | 3839 } |
| 3548 abstract class B = A with M;'''); | 3840 abstract class B = A with M;'''); |
| 3549 computeLibrarySourceErrors(source); | 3841 computeLibrarySourceErrors(source); |
| 3550 assertNoErrors(source); | 3842 assertNoErrors(source); |
| 3551 verify([source]); | 3843 verify([source]); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3616 m(p); | 3908 m(p); |
| 3617 } | 3909 } |
| 3618 class B extends A { | 3910 class B extends A { |
| 3619 noSuchMethod(v) => ''; | 3911 noSuchMethod(v) => ''; |
| 3620 }'''); | 3912 }'''); |
| 3621 computeLibrarySourceErrors(source); | 3913 computeLibrarySourceErrors(source); |
| 3622 assertNoErrors(source); | 3914 assertNoErrors(source); |
| 3623 verify([source]); | 3915 verify([source]); |
| 3624 } | 3916 } |
| 3625 | 3917 |
| 3626 void test_nonAbstractClassInheritsAbstractMemberOne_overridesMethodInObject()
{ | 3918 void test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_mixin() { |
| 3919 Source source = addSource(r''' |
| 3920 class A { |
| 3921 noSuchMethod(v) => ''; |
| 3922 } |
| 3923 class B extends Object with A { |
| 3924 m(p); |
| 3925 }'''); |
| 3926 computeLibrarySourceErrors(source); |
| 3927 assertNoErrors(source); |
| 3928 verify([source]); |
| 3929 } |
| 3930 |
| 3931 void |
| 3932 test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_superclass() { |
| 3933 Source source = addSource(r''' |
| 3934 class A { |
| 3935 noSuchMethod(v) => ''; |
| 3936 } |
| 3937 class B extends A { |
| 3938 m(p); |
| 3939 }'''); |
| 3940 computeLibrarySourceErrors(source); |
| 3941 assertNoErrors(source); |
| 3942 verify([source]); |
| 3943 } |
| 3944 |
| 3945 void |
| 3946 test_nonAbstractClassInheritsAbstractMemberOne_overridesMethodInObject() { |
| 3627 Source source = addSource(r''' | 3947 Source source = addSource(r''' |
| 3628 class A { | 3948 class A { |
| 3629 String toString([String prefix = '']) => '${prefix}Hello'; | 3949 String toString([String prefix = '']) => '${prefix}Hello'; |
| 3630 } | 3950 } |
| 3631 class C {} | 3951 class C {} |
| 3632 class B extends A with C {}'''); | 3952 class B extends A with C {}'''); |
| 3633 computeLibrarySourceErrors(source); | 3953 computeLibrarySourceErrors(source); |
| 3634 assertNoErrors(source); | 3954 assertNoErrors(source); |
| 3635 verify([source]); | 3955 verify([source]); |
| 3636 } | 3956 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 3662 !true; | 3982 !true; |
| 3663 !false; | 3983 !false; |
| 3664 !pb; | 3984 !pb; |
| 3665 !pd; | 3985 !pd; |
| 3666 }'''); | 3986 }'''); |
| 3667 computeLibrarySourceErrors(source); | 3987 computeLibrarySourceErrors(source); |
| 3668 assertNoErrors(source); | 3988 assertNoErrors(source); |
| 3669 verify([source]); | 3989 verify([source]); |
| 3670 } | 3990 } |
| 3671 | 3991 |
| 3992 void test_nonBoolNegationExpression_dynamic() { |
| 3993 Source source = addSource(r''' |
| 3994 f1(bool dynamic) { |
| 3995 !dynamic; |
| 3996 } |
| 3997 f2() { |
| 3998 bool dynamic = true; |
| 3999 !dynamic; |
| 4000 } |
| 4001 '''); |
| 4002 computeLibrarySourceErrors(source); |
| 4003 assertNoErrors(source); |
| 4004 verify([source]); |
| 4005 } |
| 4006 |
| 3672 void test_nonBoolOperand_and_bool() { | 4007 void test_nonBoolOperand_and_bool() { |
| 3673 Source source = addSource(r''' | 4008 Source source = addSource(r''' |
| 3674 bool f(bool left, bool right) { | 4009 bool f(bool left, bool right) { |
| 3675 return left && right; | 4010 return left && right; |
| 3676 }'''); | 4011 }'''); |
| 3677 computeLibrarySourceErrors(source); | 4012 computeLibrarySourceErrors(source); |
| 3678 assertNoErrors(source); | 4013 assertNoErrors(source); |
| 3679 verify([source]); | 4014 verify([source]); |
| 3680 } | 4015 } |
| 3681 | 4016 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 3702 void test_nonBoolOperand_or_dynamic() { | 4037 void test_nonBoolOperand_or_dynamic() { |
| 3703 Source source = addSource(r''' | 4038 Source source = addSource(r''' |
| 3704 bool f(dynamic left, right) { | 4039 bool f(dynamic left, right) { |
| 3705 return left || right; | 4040 return left || right; |
| 3706 }'''); | 4041 }'''); |
| 3707 computeLibrarySourceErrors(source); | 4042 computeLibrarySourceErrors(source); |
| 3708 assertNoErrors(source); | 4043 assertNoErrors(source); |
| 3709 verify([source]); | 4044 verify([source]); |
| 3710 } | 4045 } |
| 3711 | 4046 |
| 4047 void test_nonConstantDefaultValue_constField() { |
| 4048 Source source = addSource(r''' |
| 4049 f([a = double.INFINITY]) { |
| 4050 }'''); |
| 4051 computeLibrarySourceErrors(source); |
| 4052 assertNoErrors(source); |
| 4053 verify([source]); |
| 4054 } |
| 4055 |
| 3712 void test_nonConstantDefaultValue_function_named() { | 4056 void test_nonConstantDefaultValue_function_named() { |
| 3713 Source source = addSource("f({x : 2 + 3}) {}"); | 4057 Source source = addSource("f({x : 2 + 3}) {}"); |
| 3714 computeLibrarySourceErrors(source); | 4058 computeLibrarySourceErrors(source); |
| 3715 assertNoErrors(source); | 4059 assertNoErrors(source); |
| 3716 verify([source]); | 4060 verify([source]); |
| 3717 } | 4061 } |
| 3718 | 4062 |
| 3719 void test_nonConstantDefaultValue_function_positional() { | 4063 void test_nonConstantDefaultValue_function_positional() { |
| 3720 Source source = addSource("f([x = 2 + 3]) {}"); | 4064 Source source = addSource("f([x = 2 + 3]) {}"); |
| 3721 computeLibrarySourceErrors(source); | 4065 computeLibrarySourceErrors(source); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3756 void test_nonConstantDefaultValue_method_positional() { | 4100 void test_nonConstantDefaultValue_method_positional() { |
| 3757 Source source = addSource(r''' | 4101 Source source = addSource(r''' |
| 3758 class A { | 4102 class A { |
| 3759 m([x = 2 + 3]) {} | 4103 m([x = 2 + 3]) {} |
| 3760 }'''); | 4104 }'''); |
| 3761 computeLibrarySourceErrors(source); | 4105 computeLibrarySourceErrors(source); |
| 3762 assertNoErrors(source); | 4106 assertNoErrors(source); |
| 3763 verify([source]); | 4107 verify([source]); |
| 3764 } | 4108 } |
| 3765 | 4109 |
| 4110 void test_nonConstantDefaultValue_typedConstList() { |
| 4111 Source source = addSource(r''' |
| 4112 class A { |
| 4113 m([p111 = const <String>[]]) {} |
| 4114 } |
| 4115 class B extends A { |
| 4116 m([p222 = const <String>[]]) {} |
| 4117 }'''); |
| 4118 computeLibrarySourceErrors(source); |
| 4119 assertNoErrors(source); |
| 4120 verify([source]); |
| 4121 } |
| 4122 |
| 3766 void test_nonConstantValueInInitializer_namedArgument() { | 4123 void test_nonConstantValueInInitializer_namedArgument() { |
| 3767 Source source = addSource(r''' | 4124 Source source = addSource(r''' |
| 3768 class A { | 4125 class A { |
| 3769 final a; | 4126 final a; |
| 3770 const A({this.a}); | 4127 const A({this.a}); |
| 3771 } | 4128 } |
| 3772 class B extends A { | 4129 class B extends A { |
| 3773 const B({b}) : super(a: b); | 4130 const B({b}) : super(a: b); |
| 3774 }'''); | 4131 }'''); |
| 3775 computeLibrarySourceErrors(source); | 4132 computeLibrarySourceErrors(source); |
| 3776 assertNoErrors(source); | 4133 assertNoErrors(source); |
| 3777 verify([source]); | 4134 verify([source]); |
| 3778 } | 4135 } |
| 3779 | 4136 |
| 3780 void test_nonConstCaseExpression() { | 4137 void test_nonConstCaseExpression_constField() { |
| 4138 Source source = addSource(r''' |
| 4139 f(double p) { |
| 4140 switch (p) { |
| 4141 case double.INFINITY: |
| 4142 return true; |
| 4143 default: |
| 4144 return false; |
| 4145 } |
| 4146 }'''); |
| 4147 computeLibrarySourceErrors(source); |
| 4148 assertErrors( |
| 4149 source, [CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]); |
| 4150 verify([source]); |
| 4151 } |
| 4152 |
| 4153 void test_nonConstCaseExpression_typeLiteral() { |
| 3781 Source source = addSource(r''' | 4154 Source source = addSource(r''' |
| 3782 f(Type t) { | 4155 f(Type t) { |
| 3783 switch (t) { | 4156 switch (t) { |
| 3784 case bool: | 4157 case bool: |
| 3785 case int: | 4158 case int: |
| 3786 return true; | 4159 return true; |
| 3787 default: | 4160 default: |
| 3788 return false; | 4161 return false; |
| 3789 } | 4162 } |
| 3790 }'''); | 4163 }'''); |
| 3791 computeLibrarySourceErrors(source); | 4164 computeLibrarySourceErrors(source); |
| 3792 assertNoErrors(source); | 4165 assertNoErrors(source); |
| 3793 verify([source]); | 4166 verify([source]); |
| 3794 } | 4167 } |
| 3795 | 4168 |
| 4169 void test_nonConstListElement_constField() { |
| 4170 Source source = addSource(r''' |
| 4171 main() { |
| 4172 const [double.INFINITY]; |
| 4173 }'''); |
| 4174 computeLibrarySourceErrors(source); |
| 4175 assertNoErrors(source); |
| 4176 verify([source]); |
| 4177 } |
| 4178 |
| 3796 void test_nonConstMapAsExpressionStatement_const() { | 4179 void test_nonConstMapAsExpressionStatement_const() { |
| 3797 Source source = addSource(r''' | 4180 Source source = addSource(r''' |
| 3798 f() { | 4181 f() { |
| 3799 const {'a' : 0, 'b' : 1}; | 4182 const {'a' : 0, 'b' : 1}; |
| 3800 }'''); | 4183 }'''); |
| 3801 computeLibrarySourceErrors(source); | 4184 computeLibrarySourceErrors(source); |
| 3802 assertNoErrors(source); | 4185 assertNoErrors(source); |
| 3803 verify([source]); | 4186 verify([source]); |
| 3804 } | 4187 } |
| 3805 | 4188 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 3816 void test_nonConstMapAsExpressionStatement_typeArguments() { | 4199 void test_nonConstMapAsExpressionStatement_typeArguments() { |
| 3817 Source source = addSource(r''' | 4200 Source source = addSource(r''' |
| 3818 f() { | 4201 f() { |
| 3819 <String, int> {'a' : 0, 'b' : 1}; | 4202 <String, int> {'a' : 0, 'b' : 1}; |
| 3820 }'''); | 4203 }'''); |
| 3821 computeLibrarySourceErrors(source); | 4204 computeLibrarySourceErrors(source); |
| 3822 assertNoErrors(source); | 4205 assertNoErrors(source); |
| 3823 verify([source]); | 4206 verify([source]); |
| 3824 } | 4207 } |
| 3825 | 4208 |
| 4209 void test_nonConstMapKey_constField() { |
| 4210 Source source = addSource(r''' |
| 4211 main() { |
| 4212 const {double.INFINITY: 0}; |
| 4213 }'''); |
| 4214 computeLibrarySourceErrors(source); |
| 4215 assertErrors(source, |
| 4216 [CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]); |
| 4217 verify([source]); |
| 4218 } |
| 4219 |
| 4220 void test_nonConstMapValue_constField() { |
| 4221 Source source = addSource(r''' |
| 4222 main() { |
| 4223 const {0: double.INFINITY}; |
| 4224 }'''); |
| 4225 computeLibrarySourceErrors(source); |
| 4226 assertNoErrors(source); |
| 4227 verify([source]); |
| 4228 } |
| 4229 |
| 3826 void test_nonConstValueInInitializer_binary_bool() { | 4230 void test_nonConstValueInInitializer_binary_bool() { |
| 3827 Source source = addSource(r''' | 4231 Source source = addSource(r''' |
| 3828 class A { | 4232 class A { |
| 3829 final v; | 4233 final v; |
| 3830 const A.a1(bool p) : v = p && true; | 4234 const A.a1(bool p) : v = p && true; |
| 3831 const A.a2(bool p) : v = true && p; | 4235 const A.a2(bool p) : v = true && p; |
| 3832 const A.b1(bool p) : v = p || true; | 4236 const A.b1(bool p) : v = p || true; |
| 3833 const A.b2(bool p) : v = true || p; | 4237 const A.b2(bool p) : v = true || p; |
| 3834 }'''); | 4238 }'''); |
| 3835 computeLibrarySourceErrors(source); | 4239 computeLibrarySourceErrors(source); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3962 }'''); | 4366 }'''); |
| 3963 computeLibrarySourceErrors(source); | 4367 computeLibrarySourceErrors(source); |
| 3964 assertNoErrors(source); | 4368 assertNoErrors(source); |
| 3965 verify([source]); | 4369 verify([source]); |
| 3966 } | 4370 } |
| 3967 | 4371 |
| 3968 void test_nonGenerativeConstructor() { | 4372 void test_nonGenerativeConstructor() { |
| 3969 Source source = addSource(r''' | 4373 Source source = addSource(r''' |
| 3970 class A { | 4374 class A { |
| 3971 A.named() {} | 4375 A.named() {} |
| 3972 factory A() {} | 4376 factory A() => null; |
| 3973 } | 4377 } |
| 3974 class B extends A { | 4378 class B extends A { |
| 3975 B() : super.named(); | 4379 B() : super.named(); |
| 3976 }'''); | 4380 }'''); |
| 3977 computeLibrarySourceErrors(source); | 4381 computeLibrarySourceErrors(source); |
| 3978 assertNoErrors(source); | 4382 assertNoErrors(source); |
| 3979 verify([source]); | 4383 verify([source]); |
| 3980 } | 4384 } |
| 3981 | 4385 |
| 3982 void test_nonTypeInCatchClause_isClass() { | 4386 void test_nonTypeInCatchClause_isClass() { |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4380 | 4784 |
| 4381 void test_recursiveFactoryRedirect() { | 4785 void test_recursiveFactoryRedirect() { |
| 4382 Source source = addSource(r''' | 4786 Source source = addSource(r''' |
| 4383 class A { | 4787 class A { |
| 4384 factory A() = B; | 4788 factory A() = B; |
| 4385 } | 4789 } |
| 4386 class B implements A { | 4790 class B implements A { |
| 4387 factory B() = C; | 4791 factory B() = C; |
| 4388 } | 4792 } |
| 4389 class C implements B { | 4793 class C implements B { |
| 4390 factory C() {} | 4794 factory C() => null; |
| 4391 }'''); | 4795 }'''); |
| 4392 computeLibrarySourceErrors(source); | 4796 computeLibrarySourceErrors(source); |
| 4393 assertNoErrors(source); | 4797 assertNoErrors(source); |
| 4394 verify([source]); | 4798 verify([source]); |
| 4395 } | 4799 } |
| 4396 | 4800 |
| 4397 void test_redirectToInvalidFunctionType() { | 4801 void test_redirectToInvalidFunctionType() { |
| 4398 Source source = addSource(r''' | 4802 Source source = addSource(r''' |
| 4399 class A implements B { | 4803 class A implements B { |
| 4400 A(int p) {} | 4804 A(int p) {} |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4799 Source source = addSource(r''' | 5203 Source source = addSource(r''' |
| 4800 class A {} | 5204 class A {} |
| 4801 class B extends A {} | 5205 class B extends A {} |
| 4802 class G<E extends A> {} | 5206 class G<E extends A> {} |
| 4803 f() { return new G<B>(); }'''); | 5207 f() { return new G<B>(); }'''); |
| 4804 computeLibrarySourceErrors(source); | 5208 computeLibrarySourceErrors(source); |
| 4805 assertNoErrors(source); | 5209 assertNoErrors(source); |
| 4806 verify([source]); | 5210 verify([source]); |
| 4807 } | 5211 } |
| 4808 | 5212 |
| 5213 void test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_hasBound() { |
| 5214 Source source = addSource(r''' |
| 5215 class A {} |
| 5216 class B extends A {} |
| 5217 typedef F<T extends A>(); |
| 5218 F<A> fa; |
| 5219 F<B> fb; |
| 5220 '''); |
| 5221 computeLibrarySourceErrors(source); |
| 5222 assertNoErrors(source); |
| 5223 verify([source]); |
| 5224 } |
| 5225 |
| 5226 void test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_hasBound2() { |
| 5227 Source source = addSource(r''' |
| 5228 class MyClass<T> {} |
| 5229 typedef MyFunction<T, P extends MyClass<T>>(); |
| 5230 class A<T, P extends MyClass<T>> { |
| 5231 MyFunction<T, P> f; |
| 5232 } |
| 5233 '''); |
| 5234 computeLibrarySourceErrors(source); |
| 5235 assertNoErrors(source); |
| 5236 verify([source]); |
| 5237 } |
| 5238 |
| 5239 void test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_noBound() { |
| 5240 Source source = addSource(r''' |
| 5241 typedef F<T>(); |
| 5242 F<int> f1; |
| 5243 F<String> f2; |
| 5244 '''); |
| 5245 computeLibrarySourceErrors(source); |
| 5246 assertNoErrors(source); |
| 5247 verify([source]); |
| 5248 } |
| 5249 |
| 4809 void test_typeArgumentNotMatchingBounds_typeArgumentList_0() { | 5250 void test_typeArgumentNotMatchingBounds_typeArgumentList_0() { |
| 4810 Source source = addSource("abstract class A<T extends A>{}"); | 5251 Source source = addSource("abstract class A<T extends A>{}"); |
| 4811 computeLibrarySourceErrors(source); | 5252 computeLibrarySourceErrors(source); |
| 4812 assertNoErrors(source); | 5253 assertNoErrors(source); |
| 4813 verify([source]); | 5254 verify([source]); |
| 4814 } | 5255 } |
| 4815 | 5256 |
| 4816 void test_typeArgumentNotMatchingBounds_typeArgumentList_1() { | 5257 void test_typeArgumentNotMatchingBounds_typeArgumentList_1() { |
| 4817 Source source = addSource("abstract class A<T extends A<A>>{}"); | 5258 Source source = addSource("abstract class A<T extends A<A>>{}"); |
| 4818 computeLibrarySourceErrors(source); | 5259 computeLibrarySourceErrors(source); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 4831 void test_typePromotion_booleanAnd_useInRight() { | 5272 void test_typePromotion_booleanAnd_useInRight() { |
| 4832 Source source = addSource(r''' | 5273 Source source = addSource(r''' |
| 4833 main(Object p) { | 5274 main(Object p) { |
| 4834 p is String && p.length != 0; | 5275 p is String && p.length != 0; |
| 4835 }'''); | 5276 }'''); |
| 4836 computeLibrarySourceErrors(source); | 5277 computeLibrarySourceErrors(source); |
| 4837 assertNoErrors(source); | 5278 assertNoErrors(source); |
| 4838 verify([source]); | 5279 verify([source]); |
| 4839 } | 5280 } |
| 4840 | 5281 |
| 4841 void test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_noAssignm
ent() { | 5282 void |
| 5283 test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_noAssignme
nt() { |
| 4842 Source source = addSource(r''' | 5284 Source source = addSource(r''' |
| 4843 callMe(f()) { f(); } | 5285 callMe(f()) { f(); } |
| 4844 main(Object p) { | 5286 main(Object p) { |
| 4845 (p is String) && callMe(() { p.length; }); | 5287 (p is String) && callMe(() { p.length; }); |
| 4846 }'''); | 5288 }'''); |
| 4847 computeLibrarySourceErrors(source); | 5289 computeLibrarySourceErrors(source); |
| 4848 assertNoErrors(source); | 5290 assertNoErrors(source); |
| 4849 verify([source]); | 5291 verify([source]); |
| 4850 } | 5292 } |
| 4851 | 5293 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4868 void test_typePromotion_conditional_useInThen() { | 5310 void test_typePromotion_conditional_useInThen() { |
| 4869 Source source = addSource(r''' | 5311 Source source = addSource(r''' |
| 4870 main(Object p) { | 5312 main(Object p) { |
| 4871 p is String ? p.length : 0; | 5313 p is String ? p.length : 0; |
| 4872 }'''); | 5314 }'''); |
| 4873 computeLibrarySourceErrors(source); | 5315 computeLibrarySourceErrors(source); |
| 4874 assertNoErrors(source); | 5316 assertNoErrors(source); |
| 4875 verify([source]); | 5317 verify([source]); |
| 4876 } | 5318 } |
| 4877 | 5319 |
| 4878 void test_typePromotion_conditional_useInThen_accessedInClosure_noAssignment()
{ | 5320 void |
| 5321 test_typePromotion_conditional_useInThen_accessedInClosure_noAssignment()
{ |
| 4879 Source source = addSource(r''' | 5322 Source source = addSource(r''' |
| 4880 callMe(f()) { f(); } | 5323 callMe(f()) { f(); } |
| 4881 main(Object p) { | 5324 main(Object p) { |
| 4882 p is String ? callMe(() { p.length; }) : 0; | 5325 p is String ? callMe(() { p.length; }) : 0; |
| 4883 }'''); | 5326 }'''); |
| 4884 computeLibrarySourceErrors(source); | 5327 computeLibrarySourceErrors(source); |
| 4885 assertNoErrors(source); | 5328 assertNoErrors(source); |
| 4886 verify([source]); | 5329 verify([source]); |
| 4887 } | 5330 } |
| 4888 | 5331 |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5266 class B extends A<List> { | 5709 class B extends A<List> { |
| 5267 m() { | 5710 m() { |
| 5268 element.last; | 5711 element.last; |
| 5269 } | 5712 } |
| 5270 }'''); | 5713 }'''); |
| 5271 computeLibrarySourceErrors(source); | 5714 computeLibrarySourceErrors(source); |
| 5272 assertNoErrors(source); | 5715 assertNoErrors(source); |
| 5273 verify([source]); | 5716 verify([source]); |
| 5274 } | 5717 } |
| 5275 | 5718 |
| 5276 void test_undefinedIdentifier_hide() { | |
| 5277 Source source = addSource(r''' | |
| 5278 library L; | |
| 5279 export 'lib1.dart' hide a;'''); | |
| 5280 addNamedSource("/lib1.dart", "library lib1;"); | |
| 5281 computeLibrarySourceErrors(source); | |
| 5282 assertNoErrors(source); | |
| 5283 verify([source]); | |
| 5284 } | |
| 5285 | |
| 5286 void test_undefinedIdentifier_show() { | |
| 5287 Source source = addSource(r''' | |
| 5288 library L; | |
| 5289 export 'lib1.dart' show a;'''); | |
| 5290 addNamedSource("/lib1.dart", "library lib1;"); | |
| 5291 computeLibrarySourceErrors(source); | |
| 5292 assertNoErrors(source); | |
| 5293 verify([source]); | |
| 5294 } | |
| 5295 | |
| 5296 void test_undefinedIdentifier_synthetic_whenExpression() { | 5719 void test_undefinedIdentifier_synthetic_whenExpression() { |
| 5297 Source source = addSource(r''' | 5720 Source source = addSource(r''' |
| 5298 print(x) {} | 5721 print(x) {} |
| 5299 main() { | 5722 main() { |
| 5300 print(is String); | 5723 print(is String); |
| 5301 }'''); | 5724 }'''); |
| 5302 computeLibrarySourceErrors(source); | 5725 computeLibrarySourceErrors(source); |
| 5303 assertErrors(source, [ParserErrorCode.MISSING_IDENTIFIER]); | 5726 assertErrors(source, [ParserErrorCode.MISSING_IDENTIFIER]); |
| 5304 } | 5727 } |
| 5305 | 5728 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5438 A.named() {} | 5861 A.named() {} |
| 5439 } | 5862 } |
| 5440 /// [new A] or [new A.named] | 5863 /// [new A] or [new A.named] |
| 5441 main() { | 5864 main() { |
| 5442 }'''); | 5865 }'''); |
| 5443 computeLibrarySourceErrors(source); | 5866 computeLibrarySourceErrors(source); |
| 5444 assertNoErrors(source); | 5867 assertNoErrors(source); |
| 5445 verify([source]); | 5868 verify([source]); |
| 5446 } | 5869 } |
| 5447 | 5870 |
| 5871 void test_unusedShownName_unresolved() { |
| 5872 Source source = addSource(r''' |
| 5873 import 'dart:math' show max, FooBar; |
| 5874 main() { |
| 5875 print(max(1, 2)); |
| 5876 } |
| 5877 '''); |
| 5878 computeLibrarySourceErrors(source); |
| 5879 assertErrors(source, [HintCode.UNDEFINED_SHOWN_NAME]); |
| 5880 } |
| 5881 |
| 5448 void test_uriDoesNotExist_dll() { | 5882 void test_uriDoesNotExist_dll() { |
| 5449 addNamedSource("/lib.dll", ""); | 5883 addNamedSource("/lib.dll", ""); |
| 5450 Source source = addSource("import 'dart-ext:lib';"); | 5884 Source source = addSource("import 'dart-ext:lib';"); |
| 5451 computeLibrarySourceErrors(source); | 5885 computeLibrarySourceErrors(source); |
| 5452 assertNoErrors(source); | 5886 assertNoErrors(source); |
| 5453 } | 5887 } |
| 5454 | 5888 |
| 5455 void test_uriDoesNotExist_dylib() { | 5889 void test_uriDoesNotExist_dylib() { |
| 5456 addNamedSource("/lib.dylib", ""); | 5890 addNamedSource("/lib.dylib", ""); |
| 5457 Source source = addSource("import 'dart-ext:lib';"); | 5891 Source source = addSource("import 'dart-ext:lib';"); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5780 reset(); | 6214 reset(); |
| 5781 } | 6215 } |
| 5782 | 6216 |
| 5783 void _check_wrongNumberOfParametersForOperator1(String name) { | 6217 void _check_wrongNumberOfParametersForOperator1(String name) { |
| 5784 _check_wrongNumberOfParametersForOperator(name, "a"); | 6218 _check_wrongNumberOfParametersForOperator(name, "a"); |
| 5785 } | 6219 } |
| 5786 | 6220 |
| 5787 CompilationUnit _getResolvedLibraryUnit(Source source) => | 6221 CompilationUnit _getResolvedLibraryUnit(Source source) => |
| 5788 analysisContext.getResolvedCompilationUnit2(source, source); | 6222 analysisContext.getResolvedCompilationUnit2(source, source); |
| 5789 } | 6223 } |
| OLD | NEW |