Index: pkg/analyzer/test/src/task/strong_mode_test.dart |
diff --git a/pkg/analyzer/test/src/task/strong_mode_test.dart b/pkg/analyzer/test/src/task/strong_mode_test.dart |
index 097d5d433335fd547f7b22dfc413d5e09616e242..b7b86e3983ccce4a2f442d588836c9b3acb74561 100644 |
--- a/pkg/analyzer/test/src/task/strong_mode_test.dart |
+++ b/pkg/analyzer/test/src/task/strong_mode_test.dart |
@@ -18,6 +18,7 @@ import '../context/abstract_context.dart'; |
main() { |
initializeTestEnvironment(); |
runReflectiveTests(InstanceMemberInferrerTest); |
+ runReflectiveTests(SetFieldTypeTest); |
runReflectiveTests(VariableGathererTest); |
} |
@@ -982,6 +983,23 @@ class B extends A { |
} |
@reflectiveTest |
+class SetFieldTypeTest extends AbstractContextTest { |
+ void test_setter_withoutParameter() { |
+ CompilationUnitElement unit = _resolve(''' |
+var x = 0; |
+set x() {} |
+'''); |
+ TopLevelVariableElement variable = unit.topLevelVariables.single; |
+ setFieldType(variable, context.typeProvider.intType); |
+ } |
+ |
+ CompilationUnitElement _resolve(String content) { |
+ Source source = addSource('/test.dart', content); |
+ return context.resolveCompilationUnit2(source, source).element; |
+ } |
+} |
+ |
+@reflectiveTest |
class VariableGathererTest extends AbstractContextTest { |
void test_creation_withFilter() { |
VariableFilter filter = (variable) => true; |